search() { runInAction(() => { this.results = crayola.filter(color => color.name.toLowerCase().includes(this.query.toLowerCase())); }); }
this.socket.on("tile_bought", data => { console.log("tile_bought", data); runInAction(() => { this.game.player_info[data.player.player_index].money = data.player.player_money; this.game.board[data.tile.tile_index] = data.tile.tile; }); });
setInterval(() => { runInAction(() => { this.game.animated_players_move.moves.shift(); if (this.game.animated_players_move.moves.length === 0) { clearInterval(movingPlayer); } }); }, 100)
this.socket.on("trade_created", data => { console.log("trade_created", data); runInAction(() => { this.game.trades.push(data.trade); }); });
this.socket.on("pay_all_players_payed", data => { console.log("pay_all_players_payed", data); runInAction(() => { this.game.player_info[data.player_index].money = this.game.player_info[data.player_index].money - (data.amount * (this.game.player_info.filter(player => player.state !== "OUT").length - 1)); this.game.player_info.forEach((player, index) => { if (index !== data.player_index) { player.money += data.amount; } }); }); });
this.socket.on("tile_upgraded", data => { console.log("tile_upgraded", data); runInAction(() => { this.game.board[data.property_index].upgrades = data.upgrades; }); });
this.socket.on("chance_card_increased", data => { console.log("chance_card_increased", data); runInAction(() => { this.game.player_info[data.player_index].pay_multiplier = data.pay_multiplier; this.game.last_chance_card = data.last_chance_card; }); });
this.socket.on("log_added", data => { console.log("log_added", data); runInAction(() => { this.game.logs.push(data.log); }); });
this.socket.on("game_started", data => { console.log("game_started", data); runInAction(() => { this.game.game_state = "STARTED"; }); });
this.socket.on("player_moved", data => { console.log("player_moved", data); runInAction(() => { this.game.player_info[data.player].position = data.position; }); });
this.socket.on("player_money_updated", data => { console.log("player_money_updated", data); runInAction(() => { this.game.player_info[data.player_index].money = data.player_money; }); });
this.socket.on("sync_player_jail_state_synced", data => { console.log("sync_player_jail_state_synced", data); runInAction(() => { this.game.player_info[data.player_index].jail_state = data.jail_state; }); });
this.socket.on("update_player_jail_rolls_updated", data => { console.log("update_player_jail_rolls_updated", data); runInAction(() => { this.game.player_info[data.player_index].jail_turns = data.jail_turns; }); });
search() { runInAction(() => { this.results = crayola.filter(color => color.name.toLowerCase().includes(this.query.toLowerCase())); }); }
this.socket.on("sync_player_jail_state_synced", data => { console.log("sync_player_jail_state_synced", data); runInAction(() => { this.game.player_info[data.player_index].jail_state = data.jail_state; }); });