/** * @param int $teamIndex * * @return Manager */ protected function createEntity($teamIndex) { $manager = new Manager(); $manager->setPreferredSkill(rand(1, 3)); $manager->setMoneyBehaviour(rand(1, 3)); $manager->setAcceptTransferScoreOffset(rand(75, 200)); $manager->setDenyTransferScoreOffset(rand(25, 75)); return $manager; }
/** * @param Manager $manager */ public function setManager(Manager $manager) { $this->manager = $manager; if (null === $manager->getTeam()) { $manager->setTeam($this); } }
/** * @param Player $player * * @return float */ private function calculateBaseValue(Player $player) { $skill = $player->getSkillDefense() * $this->manager->getTransferFactorDefensiveSkill() + $player->getSkillOffense() * $this->manager->getTransferFactorOffensiveSkill(); return $skill / ($this->manager->getTransferFactorDefensiveSkill() + $this->manager->getTransferFactorOffensiveSkill()); }
private function assertTransferFactorMoneyBehaviour($factor, $moneyBehaviour) { $this->manager->setMoneyBehaviour($moneyBehaviour); $this->assertEquals($factor, $this->manager->getTransferFactorMoneyBehaviour()); }
/** * @param int $preferredSkill * @param int $moneyBehaviour * @param int $money * * @return Manager */ private function createManager($preferredSkill, $moneyBehaviour, $money) { $manager = new Manager(); $manager->setPreferredSkill($preferredSkill); $manager->setMoneyBehaviour($moneyBehaviour); $manager->setTeam($this->createTeam($money)); return $manager; }