public function __construct(PlayersInGame $playersInGame) { $this->track = new Track(); $this->yards = new SplObjectStorage(); /** @var Player $player */ foreach ($playersInGame as $player) { $this->yards->attach($player, new Yard($player, $this->track->getStartingSquare($player))); } }