public function postTeamFormation(Request $request) { $formationStructure = FormationFactory::getFormationStructure($request->get("formation")); $this->team->setFormation($formationStructure); $formation = new Formation($formationStructure, $this->team); $formation->spreadPlayersOnPositions(); return ['active' => $this->team->getActivePlayers(), 'passive' => $this->team->getPasivePlayers()]; }
public function getFormation() { return FormationFactory::getFormationStructure($this->team->formation); }