private static bool CanMoveOut(StandardStation fromStation, StationLocation toStationLocation)
 {
     if (toStationLocation == fromStation.StationLocation.OppositeStationLocation())
     {
         return(StandardStation.CanMoveOutTowardsOppositeDeck());
     }
     if (toStationLocation == fromStation.StationLocation.RedwardStationLocation())
     {
         return(fromStation.CanMoveOutTowardsRed());
     }
     if (toStationLocation == fromStation.StationLocation.BluewardStationLocation())
     {
         return(fromStation.CanMoveOutTowardsBlue());
     }
     throw new InvalidOperationException("Could not determine if player could heroically move out of current station");
 }
 private static bool MoveOut(
     Player performingPlayer,
     int currentTurn,
     StandardStation fromStation,
     StationLocation toStationLocation)
 {
     if (toStationLocation == fromStation.StationLocation.OppositeStationLocation())
     {
         return(fromStation.PerformMoveOutTowardsOppositeDeck(performingPlayer, currentTurn, true));
     }
     if (toStationLocation == fromStation.StationLocation.RedwardStationLocation())
     {
         return(fromStation.PerformMoveOutTowardsRed(performingPlayer, currentTurn));
     }
     if (toStationLocation == fromStation.StationLocation.BluewardStationLocation())
     {
         return(fromStation.PerformMoveOutTowardsBlue(performingPlayer, currentTurn));
     }
     throw new InvalidOperationException("Could not find a path to heroically move out of current station");
 }
        //TODO: Wire up all 3 stations if variable range interceptors are allowed
        public SittingDuck()
        {
            CurrentThreatBuffs     = new Dictionary <ExternalThreat, ExternalThreatBuff>();
            CurrentInternalThreats = new List <InternalThreat>();
            CurrentExternalThreats = new List <ExternalThreat>();
            var whiteReactor                = new CentralReactor();
            var redReactor                  = new SideReactor(whiteReactor);
            var blueReactor                 = new SideReactor(whiteReactor);
            var redBatteryPack              = new BatteryPack();
            var blueBatteryPack             = new BatteryPack();
            var computerComponent           = new ComputerComponent();
            var visualConfirmationComponent = new VisualConfirmationComponent();
            var rocketsComponent            = new RocketsComponent();

            Computer = computerComponent;
            VisualConfirmationComponent = visualConfirmationComponent;
            RocketsComponent            = rocketsComponent;
            var interceptorStation = new InterceptorStation
            {
                StationLocation = StationLocation.Interceptor
            };
            var upperRedStation = new StandardStation
            {
                Cannon          = new SideHeavyLaserCannon(redReactor, ZoneLocation.Red),
                EnergyContainer = new SideShield(redReactor),
                StationLocation = StationLocation.UpperRed
            };

            interceptorStation.InterceptorComponent = new InterceptorComponent(null, upperRedStation);
            upperRedStation.CComponent = new InterceptorComponent(interceptorStation, null);
            var upperWhiteStation = new StandardStation
            {
                Cannon          = new CentralHeavyLaserCannon(whiteReactor, ZoneLocation.White),
                EnergyContainer = new CentralShield(whiteReactor),
                StationLocation = StationLocation.UpperWhite,
                CComponent      = computerComponent
            };
            var upperBlueStation = new StandardStation
            {
                Cannon          = new SideHeavyLaserCannon(blueReactor, ZoneLocation.Blue),
                EnergyContainer = new SideShield(blueReactor),
                StationLocation = StationLocation.UpperBlue,
                CComponent      = new BattleBotsComponent()
            };
            var lowerRedStation = new StandardStation
            {
                Cannon          = new SideLightLaserCannon(redBatteryPack, ZoneLocation.Red),
                EnergyContainer = redReactor,
                StationLocation = StationLocation.LowerRed,
                CComponent      = new BattleBotsComponent()
            };

            var lowerWhiteStation = new StandardStation
            {
                Cannon          = new PulseCannon(whiteReactor),
                EnergyContainer = whiteReactor,
                StationLocation = StationLocation.LowerWhite,
                CComponent      = visualConfirmationComponent
            };
            var lowerBlueStation = new StandardStation
            {
                Cannon          = new SideLightLaserCannon(blueBatteryPack, ZoneLocation.Blue),
                EnergyContainer = blueReactor,
                StationLocation = StationLocation.LowerBlue,
                CComponent      = rocketsComponent
            };

            upperRedStation.BluewardStation       = upperWhiteStation;
            upperRedStation.OppositeDeckStation   = lowerRedStation;
            upperWhiteStation.RedwardStation      = upperRedStation;
            upperWhiteStation.BluewardStation     = upperBlueStation;
            upperWhiteStation.OppositeDeckStation = lowerWhiteStation;
            upperBlueStation.RedwardStation       = upperWhiteStation;
            upperBlueStation.OppositeDeckStation  = lowerBlueStation;
            lowerRedStation.BluewardStation       = lowerWhiteStation;
            lowerRedStation.OppositeDeckStation   = upperRedStation;
            lowerWhiteStation.RedwardStation      = lowerRedStation;
            lowerWhiteStation.BluewardStation     = lowerBlueStation;
            lowerWhiteStation.OppositeDeckStation = upperWhiteStation;
            lowerBlueStation.RedwardStation       = lowerWhiteStation;
            lowerBlueStation.OppositeDeckStation  = upperBlueStation;

            RedZone = new Zone {
                LowerStation = lowerRedStation, UpperStation = upperRedStation, ZoneLocation = ZoneLocation.Red, Gravolift = new Gravolift()
            };
            WhiteZone = new Zone {
                LowerStation = lowerWhiteStation, UpperStation = upperWhiteStation, ZoneLocation = ZoneLocation.White, Gravolift = new Gravolift()
            };
            BlueZone = new Zone {
                LowerStation = lowerBlueStation, UpperStation = upperBlueStation, ZoneLocation = ZoneLocation.Blue, Gravolift = new Gravolift()
            };
            ZonesByLocation   = new[] { RedZone, WhiteZone, BlueZone }.ToDictionary(zone => zone.ZoneLocation);
            StationByLocation = Zones
                                .SelectMany(zone => new[] { zone.LowerStation, zone.UpperStation })
                                .Concat(new Station[] { interceptorStation })
                                .ToDictionary(station => station.StationLocation);
            InterceptorStation = interceptorStation;
        }