/** * When a player wins this fn will be involved * * @param player $player who is win */ function win($player, $position) { $this->state = 3; foreach ($this->players as $p) { $p->change_state(3); } $player->send_message(4, 2 . ",{$position},{$this->cur_turn}"); $player->competitor->send_message(4, 3 . ",{$position},{$this->cur_turn}"); }