Ejemplo n.º 1
0
 public BuildMode(ShipTopology topology, Planet planet)
 {
     _topology  = topology;
     State      = BuildModeState.AwaitingBegin;
     _countIn   = new CompletionTimer(TimeSpan.FromSeconds(3));
     _countDown = new CompletionTimer(TimeSpan.FromSeconds(planet == Planet.Earth ? 80 : 50));
     _countOut  = new CompletionTimer(TimeSpan.FromSeconds(5));
 }
Ejemplo n.º 2
0
        private ShipTopology CreateDrone()
        {
            var topology = new ShipTopology(2, 2);

            topology.SetSection(new Point(0, 0), new Section(new BlasterModule(), ConnectionLayouts.FullyConnected, 4));
            topology.SetSection(new Point(0, 1), new Section(new RocketModule(), ConnectionLayouts.FullyConnected, 1));
            topology.SetSection(new Point(1, 0), new Section(new BlasterModule(), ConnectionLayouts.FullyConnected, 4));
            return(topology);
        }
Ejemplo n.º 3
0
        private ShipTopology CreateWall(int wallWave)
        {
            var topology = new ShipTopology(14, 3);

            for (var i = 0; i < 14; i++)
            {
                for (var j = 0; j < 3; j++)
                {
                    if (j == 2)
                    {
                        topology.SetSection(new Point(i, j), new Section(new RocketModule(), ConnectionLayouts.FullyConnected, i == 0 ? 0 : i == 13 ? 2 : 1));
                    }
                    else if (j == 1 && i > 0 && i < 13)
                    {
                        topology.SetSection(new Point(i, j), new Section(new EnergyModule(), ConnectionLayouts.FullyConnected, i == 0 ? 0 : i == 3 ? 2 : 1));
                    }
                    else
                    {
                        topology.SetSection(new Point(i, j), new Section(_armoured ? new ArmourModule() as Module : new EmptyModule(), ConnectionLayouts.FullyConnected, 4));
                    }
                }
            }

            if (wallWave == 1)
            {
                topology.SetSection(new Point(6, 1), new Section(new EmptyModule(), ConnectionLayouts.FullyConnected, 0));
            }
            if (wallWave == 2)
            {
                topology.SetSection(new Point(4, 1), new Section(new EmptyModule(), ConnectionLayouts.FullyConnected, 0));
                topology.SetSection(new Point(8, 1), new Section(new EmptyModule(), ConnectionLayouts.FullyConnected, 0));
            }

            topology.SetSection(new Point(1, 0), new Section(new BlasterModule(), ConnectionLayouts.FullyConnected, 4));
            topology.SetSection(new Point(3, 0), new Section(new BombardModule(), ConnectionLayouts.FullyConnected, 4));
            topology.SetSection(new Point(5, 0), new Section(new BlasterModule(), ConnectionLayouts.FullyConnected, 4));
            topology.SetSection(new Point(7, 0), new Section(new BombardModule(), ConnectionLayouts.FullyConnected, 4));
            topology.SetSection(new Point(9, 0), new Section(new BlasterModule(), ConnectionLayouts.FullyConnected, 4));
            topology.SetSection(new Point(11, 0), new Section(new BombardModule(), ConnectionLayouts.FullyConnected, 4));
            topology.SetSection(new Point(13, 0), new Section(new BlasterModule(), ConnectionLayouts.FullyConnected, 4));
            return(topology);
        }
Ejemplo n.º 4
0
        private ShipTopology CreateBandit()
        {
            var topology = new ShipTopology(4, 4);

            for (var i = 0; i < 4; i++)
            {
                for (var j = 0; j < 4; j++)
                {
                    topology.SetSection(new Point(i, j), new Section(new EmptyModule(), ConnectionLayouts.FullyConnected, 4));
                }
            }
            topology.SetSection(new Point(0, 0), new Section(new BlasterModule(), ConnectionLayouts.FullyConnected, 3));
            topology.SetSection(new Point(1, 0), new Section(new BlasterModule(), ConnectionLayouts.FullyConnected, 4));
            topology.SetSection(new Point(2, 0), new Section(new BlasterModule(), ConnectionLayouts.FullyConnected, 5));
            topology.SetSection(new Point(3, 0), new Section(new BlasterModule(), ConnectionLayouts.FullyConnected, 6));
            topology.SetSection(new Point(0, 3), new Section(new RocketModule(), ConnectionLayouts.FullyConnected, 0));
            topology.SetSection(new Point(1, 3), new Section(new RocketModule(), ConnectionLayouts.FullyConnected, 1));
            topology.SetSection(new Point(2, 3), new Section(new RocketModule(), ConnectionLayouts.FullyConnected, 1));
            topology.SetSection(new Point(3, 3), new Section(new RocketModule(), ConnectionLayouts.FullyConnected, 2));

            topology.SetSection(new Point(1, 2), new Section(new EnergyModule(), ConnectionLayouts.FullyConnected, 4));
            topology.SetSection(new Point(2, 2), new Section(new EnergyModule(), ConnectionLayouts.FullyConnected, 2));
            return(topology);
        }
Ejemplo n.º 5
0
 public FlightNode(FlightShip ship, Point gridPosition, ShipTopology shipTopology)
 {
     _ship         = ship;
     GridLocation  = gridPosition;
     _shipTopology = shipTopology;
 }
Ejemplo n.º 6
0
 public FlightShip(ShipTopology topology, Guid?shipGuid = null)
 {
     _topology = topology;
     ShipGuid  = shipGuid ?? Guid.NewGuid();
 }
Ejemplo n.º 7
0
 public FlightScene(Planet planet, ShipTopology shipTopology, IEnumerable <Func <Phase> > phaseFactories)
 {
     _planet         = planet;
     _shipTopology   = shipTopology;
     _phaseFactories = phaseFactories;
 }
Ejemplo n.º 8
0
        public void ClickFlight(ClickUIEvent ev)
        {
            var keys = Keyboard.GetState();

            if (!keys.IsKeyDown(Keys.LeftControl))
            {
                _fadeTransition.StartTransition(() =>
                {
                    _sceneManager.SetScene(new CreditsScene());
                });
                return;
            }

            var topology = new ShipTopology(6, 5);

            if (keys.IsKeyDown(Keys.D9))
            {
                for (var i = 0; i < 6; i++)
                {
                    for (var j = 0; j < 5; j++)
                    {
                        topology.SetSection(new Point(i, j), new Section(
                                                new RocketModule(),
                                                ConnectionLayouts.FullyConnected,
                                                1
                                                ));
                    }
                }
            }

            topology.SetSection(new Point(2, 2), new Section(
                                    new ResearchCenterModule(),
                                    ConnectionLayouts.FullyConnected
                                    ));
            topology.SetSection(new Point(2, 1), new Section(
                                    new BlasterModule(),
                                    ConnectionLayouts.FullyConnected,
                                    4
                                    ));
            topology.SetSection(new Point(3, 1), new Section(
                                    new BombardModule(),
                                    ConnectionLayouts.FullyConnected,
                                    4
                                    ));
            topology.SetSection(new Point(2, 3), new Section(
                                    new RocketModule(),
                                    ConnectionLayouts.FullyConnected,
                                    1
                                    ));
            topology.SetSection(new Point(1, 3), new Section(
                                    new RocketModule(),
                                    ConnectionLayouts.FullyConnected,
                                    2
                                    ));
            topology.SetSection(new Point(3, 3), new Section(
                                    new RocketModule(),
                                    ConnectionLayouts.FullyConnected,
                                    OffDirection.SouthEast
                                    ));
            topology.SetSection(new Point(3, 2), new Section(
                                    new RotaryEngine(),
                                    ConnectionLayouts.FullyConnected,
                                    1
                                    ));
            topology.SetSection(new Point(4, 2), new Section(
                                    new RotaryEngine(),
                                    ConnectionLayouts.FullyConnected,
                                    1
                                    ));
            topology.SetSection(new Point(5, 2), new Section(
                                    new RotaryEngine(),
                                    ConnectionLayouts.FullyConnected,
                                    1
                                    ));
            topology.ApplyUpgrade(new RapidFire());
            var orchestrator = _menuScene.Create(false).Add(new Orchestrator(topology));

            orchestrator.CurrentPlanet = Planet.Earth;
            orchestrator.NextFlight();

            //_menuScene.SetScene(new FlightScene(topology));
        }
Ejemplo n.º 9
0
 public BuildFloor(ShipTopology shipTopology)
 {
     _shipTopology = shipTopology;
 }
Ejemplo n.º 10
0
 public BuildScene(ShipTopology shipTopology, Planet planet)
 {
     _shipTopology = shipTopology;
     _planet       = planet;
 }
Ejemplo n.º 11
0
 public BuildNode(Point gridPosition, ShipTopology shipTopology)
 {
     GridLocation  = gridPosition;
     _shipTopology = shipTopology;
 }
Ejemplo n.º 12
0
        private ShipTopology CreateWall(int wallWave)
        {
            var topology = new ShipTopology(10, 10);

            for (var i = 0; i < 10; i++)
            {
                for (var j = 0; j < 10; j++)
                {
                    if (j == 9)
                    {
                        topology.SetSection(new Point(i, j), new Section(new RocketModule(), ConnectionLayouts.FullyConnected, i == 0 ? 0 : i == 9 ? 2 : 1));
                    }
                    else
                    {
                        topology.SetSection(new Point(i, j), new Section(new ArmourModule(), ConnectionLayouts.FullyConnected, 4));
                    }
                }
            }


            topology.SetSection(new Point(0, 0), new Section(new ShieldBubbleGeneratorModule(), ConnectionLayouts.FullyConnected, 2));
            topology.SetSection(new Point(4, 4), new Section(new ResearchCenterModule(), ConnectionLayouts.FullyConnected, 2));
            topology.SetSection(new Point(3, 4), new Section(new ResearchCenterModule(), ConnectionLayouts.FullyConnected, 2));
            topology.SetSection(new Point(4, 5), new Section(new EnergyModule(), ConnectionLayouts.FullyConnected, 2));
            topology.SetSection(new Point(6, 7), new Section(new EnergyModule(), ConnectionLayouts.FullyConnected, 2));
            topology.SetSection(new Point(8, 5), new Section(new EnergyModule(), ConnectionLayouts.FullyConnected, 2));
            topology.SetSection(new Point(3, 4), new Section(new EnergyModule(), ConnectionLayouts.FullyConnected, 2));
            topology.SetSection(new Point(2, 2), new Section(new EnergyModule(), ConnectionLayouts.FullyConnected, 2));
            topology.SetSection(new Point(2, 3), new Section(new ShieldBubbleGeneratorModule(), ConnectionLayouts.FullyConnected, 2));
            topology.SetSection(new Point(2, 5), new Section(new EnergyModule(), ConnectionLayouts.FullyConnected, 2));
            topology.SetSection(new Point(2, 6), new Section(new ShieldBubbleGeneratorModule(), ConnectionLayouts.FullyConnected, 2));
            topology.SetSection(new Point(2, 8), new Section(new EnergyModule(), ConnectionLayouts.FullyConnected, 2));
            topology.SetSection(new Point(8, 2), new Section(new EnergyModule(), ConnectionLayouts.FullyConnected, 2));
            topology.SetSection(new Point(8, 5), new Section(new EnergyModule(), ConnectionLayouts.FullyConnected, 2));
            topology.SetSection(new Point(8, 8), new Section(new EnergyModule(), ConnectionLayouts.FullyConnected, 2));
            topology.SetSection(new Point(4, 2), new Section(new EnergyModule(), ConnectionLayouts.FullyConnected, 2));
            topology.SetSection(new Point(4, 3), new Section(new ShieldBubbleGeneratorModule(), ConnectionLayouts.FullyConnected, 2));
            topology.SetSection(new Point(4, 5), new Section(new EnergyModule(), ConnectionLayouts.FullyConnected, 2));
            topology.SetSection(new Point(4, 6), new Section(new ShieldBubbleGeneratorModule(), ConnectionLayouts.FullyConnected, 2));
            topology.SetSection(new Point(4, 8), new Section(new EnergyModule(), ConnectionLayouts.FullyConnected, 2));


            topology.SetSection(new Point(1, 0), new Section(new BlasterModule(), ConnectionLayouts.FullyConnected, 4));
            topology.SetSection(new Point(2, 0), new Section(new BombardModule(), ConnectionLayouts.FullyConnected, 3));
            topology.SetSection(new Point(3, 0), new Section(new BombardModule(), ConnectionLayouts.FullyConnected, 4));
            topology.SetSection(new Point(4, 0), new Section(new BombardModule(), ConnectionLayouts.FullyConnected, 5));
            topology.SetSection(new Point(5, 0), new Section(new ShieldBubbleGeneratorModule(), ConnectionLayouts.FullyConnected, 2));
            topology.SetSection(new Point(6, 0), new Section(new BombardModule(), ConnectionLayouts.FullyConnected, 3));
            topology.SetSection(new Point(7, 0), new Section(new BombardModule(), ConnectionLayouts.FullyConnected, 4));
            topology.SetSection(new Point(8, 0), new Section(new BombardModule(), ConnectionLayouts.FullyConnected, 5));
            topology.SetSection(new Point(9, 0), new Section(new BlasterModule(), ConnectionLayouts.FullyConnected, 4));

            topology.SetSection(new Point(0, 1), new Section(new BombardModule(), ConnectionLayouts.FullyConnected, 2));
            topology.SetSection(new Point(0, 2), new Section(new BombardModule(), ConnectionLayouts.FullyConnected, 3));
            topology.SetSection(new Point(0, 3), new Section(new BombardModule(), ConnectionLayouts.FullyConnected, 4));
            topology.SetSection(new Point(0, 4), new Section(new ShieldBubbleGeneratorModule(), ConnectionLayouts.FullyConnected, 4));
            topology.SetSection(new Point(0, 5), new Section(new BombardModule(), ConnectionLayouts.FullyConnected, 2));
            topology.SetSection(new Point(0, 6), new Section(new BombardModule(), ConnectionLayouts.FullyConnected, 3));
            topology.SetSection(new Point(0, 7), new Section(new BombardModule(), ConnectionLayouts.FullyConnected, 4));
            topology.SetSection(new Point(0, 8), new Section(new BlasterModule(), ConnectionLayouts.FullyConnected, 3));
            topology.SetSection(new Point(0, 9), new Section(new BlasterModule(), ConnectionLayouts.FullyConnected, 3));

            topology.SetSection(new Point(9, 1), new Section(new BlasterModule(), ConnectionLayouts.FullyConnected, 5));
            topology.SetSection(new Point(9, 2), new Section(new BombardModule(), ConnectionLayouts.FullyConnected, 4));
            topology.SetSection(new Point(9, 3), new Section(new BombardModule(), ConnectionLayouts.FullyConnected, 5));
            topology.SetSection(new Point(9, 4), new Section(new BombardModule(), ConnectionLayouts.FullyConnected, 0));
            topology.SetSection(new Point(9, 5), new Section(new BlasterModule(), ConnectionLayouts.FullyConnected, 5));
            topology.SetSection(new Point(9, 6), new Section(new BombardModule(), ConnectionLayouts.FullyConnected, 4));
            topology.SetSection(new Point(9, 7), new Section(new BombardModule(), ConnectionLayouts.FullyConnected, 5));
            topology.SetSection(new Point(9, 8), new Section(new BombardModule(), ConnectionLayouts.FullyConnected, 0));
            topology.SetSection(new Point(9, 9), new Section(new BlasterModule(), ConnectionLayouts.FullyConnected, 5));
            topology.ApplyUpgrade(new BlastRocketry());
            // topology.ApplyUpgrade(new BombardOverload());
            topology.ApplyUpgrade(new ShieldAmplification());
            topology.ApplyUpgrade(new ShieldFortification());

            return(topology);
        }
Ejemplo n.º 13
0
 public Orchestrator(ShipTopology shipTopology = null)
 {
     _shipTopology = shipTopology;
     if (_shipTopology == null)
     {
         _shipTopology = new ShipTopology(6, 5);
         _shipTopology.SetSection(new Point(2, 2), new Section(
                                      new ResearchCenterModule(),
                                      ConnectionLayouts.FullyConnected
                                      ));
     }
     AddPlanet(
         Planet.Earth,
         () => new AsteroidPhase(10, AsteroidDistributions.StandardAsteroidDistribution),
         () => new OutOfBoundsPhase(),
         () => new TransmissionPhase(),
         () => new BanditPhase(0),
         () => new SatellitePhase(Planet.Mars)
         );
     AddPlanet(
         Planet.Mars,
         () => new AsteroidPhase(20, AsteroidDistributions.StandardAsteroidDistribution),
         () => new DroneStrikePhase(3),
         () => new TransmissionPhase(),
         () => new StormWallBossPhase(false),
         () => new SatellitePhase(Planet.Jupiter)
         );
     AddPlanet(
         Planet.Jupiter,
         () => new IceAsteroidPhase(20, AsteroidDistributions.IceAsteroidDistribution),
         () => new BanditPhase(1),
         () => new TransmissionPhase(),
         () => new AsteroidPhase(30, AsteroidDistributions.StandardAsteroidDistribution),
         () => new SatellitePhase(Planet.Saturn)
         );
     AddPlanet(
         Planet.Saturn,
         () => new IceAsteroidPhase(40, AsteroidDistributions.IceAsteroidDistribution),
         () => new TransmissionPhase(),
         () => new BanditPhase(2),
         () => new AsteroidPhase(50, AsteroidDistributions.StandardAsteroidDistribution),
         () => new StormWallBossPhase(true),
         () => new SatellitePhase(Planet.Uranus)
         );
     AddPlanet(
         Planet.Uranus,
         () => new IceAsteroidPhase(60, AsteroidDistributions.IceAsteroidDistribution),
         () => new TransmissionPhase(),
         () => new DroneStrikePhase(5),
         () => new AsteroidPhase(70, AsteroidDistributions.StandardAsteroidDistribution),
         () => new SatellitePhase(Planet.Neptune)
         );
     AddPlanet(
         Planet.Neptune,
         () => new IceAsteroidPhase(90, AsteroidDistributions.IceAsteroidDistribution),
         () => new TransmissionPhase(),
         () => new DroneStrikePhase(6),
         () => new AsteroidPhase(100, AsteroidDistributions.StandardAsteroidDistribution),
         () => new GalactusBossPhase(),
         () => new AsteroidPhase(100, AsteroidDistributions.StandardAsteroidDistribution)
         );
 }