protected override void PerformYAction(int currentTurn) { var upperRedPlayers = SittingDuck.GetPlayersInStation(StationLocation.UpperRed); var lowerRedPlayers = SittingDuck.GetPlayersInStation(StationLocation.LowerRed); var upperBluePlayers = SittingDuck.GetPlayersInStation(StationLocation.UpperBlue); var lowerBluePlayers = SittingDuck.GetPlayersInStation(StationLocation.LowerBlue); SittingDuck.TeleportPlayers(upperRedPlayers, StationLocation.UpperBlue); SittingDuck.TeleportPlayers(lowerRedPlayers, StationLocation.LowerBlue); SittingDuck.TeleportPlayers(upperBluePlayers, StationLocation.UpperRed); SittingDuck.TeleportPlayers(lowerBluePlayers, StationLocation.LowerRed); }
private void TeleportPlayersToOppositeDecks() { var playersByStation = EnumFactory.All <StationLocation>() .Where(stationLocation => stationLocation.IsOnShip()) .Select(stationLocation => new { Players = SittingDuck.GetPlayersInStation(stationLocation).ToList(), StationLocation = stationLocation }) .ToList(); foreach (var playerList in playersByStation) { SittingDuck.TeleportPlayers( playerList.Players, playerList.StationLocation.OppositeStationLocation().GetValueOrDefault()); } }