Esempio n. 1
0
        protected override void PerformYAction(int currentTurn)
        {
            var otherPlayersInStation = SittingDuck.GetPlayersInStation(attachedPlayer.CurrentStation.StationLocation)
                                        .Except(new [] { attachedPlayer });

            foreach (var player in otherPlayersInStation)
            {
                player.KnockOut();
            }
        }
        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);
        }
Esempio n. 3
0
        private void InfectPlayers()
        {
            if (infectedPlayers == null)
            {
                infectedPlayers = new InfectedPlayers(this);
                infectedPlayers.Initialize(SittingDuck, ThreatController, EventMaster);
                ThreatController.AddInternalThreat(infectedPlayers, TimeAppears, Position);
            }
            var playersInCurrentStation = SittingDuck.GetPlayersInStation(CurrentStation);

            foreach (var player in playersInCurrentStation)
            {
                infectedPlayers.InfectPlayer(player);
            }
        }
        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());
            }
        }