/** * @see ISimulationObserver::onBallPassFailure() */ public function onBallPassFailure(SimulationMatch $match, SimulationPlayer $player) { if ($player->position != PLAYER_POSITION_GOALY) { // select random theoretical pass target $targetPlayer = SimulationHelper::selectPlayer($player->team, $player->position, $player); $this->_createMessage($match, 'Pass_daneben', array($player->name, $targetPlayer->name), $player->team->id == $match->homeTeam->id); } }
private function _kickoff(SimulationMatch $match, SimulationPlayer $scorer) { // let kick-off the opponent $match->setPlayerWithBall(SimulationHelper::selectPlayer(SimulationHelper::getOpponentTeam($scorer, $match), PLAYER_POSITION_DEFENCE, null)); }