Exemplo n.º 1
0
        public void UpdateSpaceship(Spaceship updatedSpaceship)
        {
            int id = updatedSpaceship.Id;

            if (Spaceships.ContainsKey(id))
            {
                Spaceships[id] = updatedSpaceship;
            }
        }
Exemplo n.º 2
0
        public void Initialise(int numberOfSpaceships, int numberOfAsteroids)
        {
            this.NextIdToAssign = 0;

            for (int i = 0; i < numberOfAsteroids; i++)
            {
                int id = NextIdToAssign;
                Asteroids.Add(id, new Asteroid(id));
            }

            for (int i = 0; i < numberOfSpaceships; i++)
            {
                int id = NextIdToAssign;
                Spaceships.Add(id, new Spaceship(id));
            }
        }
Exemplo n.º 3
0
        public Object GetObjectById(int id)
        {
            Object returnObject;

            if (Spaceships.ContainsKey(id))
            {
                returnObject = Spaceships[id];
            }
            else if (Asteroids.ContainsKey(id))
            {
                returnObject = Asteroids[id];
            }
            else
            {
                returnObject = new Object();
            }

            return(returnObject);
        }
Exemplo n.º 4
0
        private void CreateDummyData()
        {
            // Star Trek
            Spaceships.Add(new Spaceship()
            {
                Size    = Spaceship.Sizes.Small,
                Engines = new List <Spaceship.EngineTypes>()
                {
                    Spaceship.EngineTypes.Inpulse
                },
                Weapons = new List <Spaceship.WeaponTypes>()
                {
                    Spaceship.WeaponTypes.Phaser, Spaceship.WeaponTypes.PhotonTorpedos
                },
                Crew     = Spaceship.CrewTypes.GoodGuys,
                Name     = "Federation attack fighter",
                ImageUri = "https://upload.wikimedia.org/wikipedia/en/thumb/9/9f/Star_Trek_movie_logo_2009.jpg/310px-Star_Trek_movie_logo_2009.jpg"
            });
            Spaceships.Add(new Spaceship()
            {
                Size    = Spaceship.Sizes.Small,
                Engines = new List <Spaceship.EngineTypes>()
                {
                    Spaceship.EngineTypes.Inpulse, Spaceship.EngineTypes.Warp
                },
                Weapons = new List <Spaceship.WeaponTypes>()
                {
                    Spaceship.WeaponTypes.None
                },
                Crew     = Spaceship.CrewTypes.GoodGuys,
                Name     = "NX Alpha",
                ImageUri = "https://upload.wikimedia.org/wikipedia/en/thumb/9/9f/Star_Trek_movie_logo_2009.jpg/310px-Star_Trek_movie_logo_2009.jpg"
            });
            Spaceships.Add(new Spaceship()
            {
                Size    = Spaceship.Sizes.Large,
                Engines = new List <Spaceship.EngineTypes>()
                {
                    Spaceship.EngineTypes.Inpulse, Spaceship.EngineTypes.Warp
                },
                Weapons = new List <Spaceship.WeaponTypes>()
                {
                    Spaceship.WeaponTypes.Phaser, Spaceship.WeaponTypes.PhotonTorpedos
                },
                Crew     = Spaceship.CrewTypes.GoodGuys,
                Name     = "Enterprise (NX-01)",
                ImageUri = "https://upload.wikimedia.org/wikipedia/en/thumb/9/9f/Star_Trek_movie_logo_2009.jpg/310px-Star_Trek_movie_logo_2009.jpg"
            });
            Spaceships.Add(new Spaceship()
            {
                Size    = Spaceship.Sizes.Large,
                Engines = new List <Spaceship.EngineTypes>()
                {
                    Spaceship.EngineTypes.Inpulse, Spaceship.EngineTypes.Warp
                },
                Weapons = new List <Spaceship.WeaponTypes>()
                {
                    Spaceship.WeaponTypes.Phaser, Spaceship.WeaponTypes.PhotonTorpedos
                },
                Crew     = Spaceship.CrewTypes.GoodGuys,
                Name     = "USS Franklin (NX-326)",
                ImageUri = "https://upload.wikimedia.org/wikipedia/en/thumb/9/9f/Star_Trek_movie_logo_2009.jpg/310px-Star_Trek_movie_logo_2009.jpg"
            });
            Spaceships.Add(new Spaceship()
            {
                Size    = Spaceship.Sizes.Large,
                Engines = new List <Spaceship.EngineTypes>()
                {
                    Spaceship.EngineTypes.Inpulse, Spaceship.EngineTypes.Warp
                },
                Weapons = new List <Spaceship.WeaponTypes>()
                {
                    Spaceship.WeaponTypes.Disruptor, Spaceship.WeaponTypes.PhotonTorpedos
                },
                Crew     = Spaceship.CrewTypes.BadGuys,
                Name     = "IKS Toh'Kaht (Klingon attack cruiser)",
                ImageUri = "https://upload.wikimedia.org/wikipedia/en/thumb/9/9f/Star_Trek_movie_logo_2009.jpg/310px-Star_Trek_movie_logo_2009.jpg"
            });
            Spaceships.Add(new Spaceship()
            {
                Size    = Spaceship.Sizes.Large,
                Engines = new List <Spaceship.EngineTypes>()
                {
                    Spaceship.EngineTypes.Inpulse, Spaceship.EngineTypes.Warp
                },
                Weapons = new List <Spaceship.WeaponTypes>()
                {
                    Spaceship.WeaponTypes.Disruptor, Spaceship.WeaponTypes.PhotonTorpedos
                },
                Crew     = Spaceship.CrewTypes.BadGuys,
                Name     = "Scimitar (Reman warbird)",
                ImageUri = "https://upload.wikimedia.org/wikipedia/en/thumb/9/9f/Star_Trek_movie_logo_2009.jpg/310px-Star_Trek_movie_logo_2009.jpg"
            });

            // Star Wars
            Spaceships.Add(new Spaceship()
            {
                Size    = Spaceship.Sizes.Small,
                Engines = new List <Spaceship.EngineTypes>()
                {
                    Spaceship.EngineTypes.Sublight
                },
                Weapons = new List <Spaceship.WeaponTypes>()
                {
                    Spaceship.WeaponTypes.Laser, Spaceship.WeaponTypes.ProtonTorpedos
                },
                Crew     = Spaceship.CrewTypes.GoodGuys,
                Name     = "X-Wing",
                ImageUri = "https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/Star_Wars_Logo.svg/1280px-Star_Wars_Logo.svg.png"
            });
            Spaceships.Add(new Spaceship()
            {
                Size    = Spaceship.Sizes.Mid,
                Engines = new List <Spaceship.EngineTypes>()
                {
                    Spaceship.EngineTypes.Sublight, Spaceship.EngineTypes.Hyper
                },
                Weapons = new List <Spaceship.WeaponTypes>()
                {
                    Spaceship.WeaponTypes.Laser, Spaceship.WeaponTypes.Missiles
                },
                Crew     = Spaceship.CrewTypes.GoodGuys,
                Name     = "Millenium Falcon (YT-1300)",
                ImageUri = "https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/Star_Wars_Logo.svg/1280px-Star_Wars_Logo.svg.png"
            });
            Spaceships.Add(new Spaceship()
            {
                Size    = Spaceship.Sizes.Large,
                Engines = new List <Spaceship.EngineTypes>()
                {
                    Spaceship.EngineTypes.Sublight, Spaceship.EngineTypes.Hyper
                },
                Weapons = new List <Spaceship.WeaponTypes>()
                {
                    Spaceship.WeaponTypes.Laser, Spaceship.WeaponTypes.Ion
                },
                Crew     = Spaceship.CrewTypes.GoodGuys,
                Name     = "Home One (MC80)",
                ImageUri = "https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/Star_Wars_Logo.svg/1280px-Star_Wars_Logo.svg.png"
            });
            Spaceships.Add(new Spaceship()
            {
                Size    = Spaceship.Sizes.Small,
                Engines = new List <Spaceship.EngineTypes>()
                {
                    Spaceship.EngineTypes.Sublight
                },
                Weapons = new List <Spaceship.WeaponTypes>()
                {
                    Spaceship.WeaponTypes.Laser, Spaceship.WeaponTypes.ProtonTorpedos
                },
                Crew     = Spaceship.CrewTypes.BadGuys,
                Name     = "Tie Fighter",
                ImageUri = "https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/Star_Wars_Logo.svg/1280px-Star_Wars_Logo.svg.png"
            });
            Spaceships.Add(new Spaceship()
            {
                Size    = Spaceship.Sizes.Small,
                Engines = new List <Spaceship.EngineTypes>()
                {
                    Spaceship.EngineTypes.Sublight, Spaceship.EngineTypes.Hyper
                },
                Weapons = new List <Spaceship.WeaponTypes>()
                {
                    Spaceship.WeaponTypes.Laser,
                    Spaceship.WeaponTypes.Ion,
                    Spaceship.WeaponTypes.ProtonTorpedos,
                    Spaceship.WeaponTypes.Missiles
                },
                Crew     = Spaceship.CrewTypes.BadGuys,
                Name     = "Slave I (Firespray-31-class)",
                ImageUri = "https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/Star_Wars_Logo.svg/1280px-Star_Wars_Logo.svg.png"
            });
            Spaceships.Add(new Spaceship()
            {
                Size    = Spaceship.Sizes.Large,
                Engines = new List <Spaceship.EngineTypes>()
                {
                    Spaceship.EngineTypes.Sublight, Spaceship.EngineTypes.Hyper
                },
                Weapons = new List <Spaceship.WeaponTypes>()
                {
                    Spaceship.WeaponTypes.Laser,
                    Spaceship.WeaponTypes.Ion,
                    Spaceship.WeaponTypes.Missiles
                },
                Crew     = Spaceship.CrewTypes.BadGuys,
                Name     = "Star Destroyer (Imperial-class)",
                ImageUri = "https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/Star_Wars_Logo.svg/1280px-Star_Wars_Logo.svg.png"
            });

            // Battlestar Galactica
            Spaceships.Add(new Spaceship()
            {
                Size    = Spaceship.Sizes.Small,
                Engines = new List <Spaceship.EngineTypes>()
                {
                    Spaceship.EngineTypes.TurboThrust
                },
                Weapons = new List <Spaceship.WeaponTypes>()
                {
                    Spaceship.WeaponTypes.KineticEnergy, Spaceship.WeaponTypes.Missiles
                },
                Crew     = Spaceship.CrewTypes.GoodGuys,
                Name     = "Viper Mk VII",
                ImageUri = "https://upload.wikimedia.org/wikipedia/en/4/40/Battlestar_Galactica_intro.jpg"
            });
            Spaceships.Add(new Spaceship()
            {
                Size    = Spaceship.Sizes.Large,
                Engines = new List <Spaceship.EngineTypes>()
                {
                    Spaceship.EngineTypes.Sublight, Spaceship.EngineTypes.FTL
                },
                Weapons = new List <Spaceship.WeaponTypes>()
                {
                    Spaceship.WeaponTypes.Batteries, Spaceship.WeaponTypes.Missiles
                },
                Crew     = Spaceship.CrewTypes.GoodGuys,
                Name     = "Battlestar Galactica",
                ImageUri = "https://upload.wikimedia.org/wikipedia/en/4/40/Battlestar_Galactica_intro.jpg"
            });
            Spaceships.Add(new Spaceship()
            {
                Size    = Spaceship.Sizes.Small,
                Engines = new List <Spaceship.EngineTypes>()
                {
                    Spaceship.EngineTypes.Sublight
                },
                Weapons = new List <Spaceship.WeaponTypes>()
                {
                    Spaceship.WeaponTypes.KineticEnergy, Spaceship.WeaponTypes.Missiles
                },
                Crew     = Spaceship.CrewTypes.BadGuys,
                Name     = "Cylon Raider",
                ImageUri = "https://upload.wikimedia.org/wikipedia/en/4/40/Battlestar_Galactica_intro.jpg"
            });
            Spaceships.Add(new Spaceship()
            {
                Size    = Spaceship.Sizes.Large,
                Engines = new List <Spaceship.EngineTypes>()
                {
                    Spaceship.EngineTypes.Sublight, Spaceship.EngineTypes.FTL
                },
                Weapons = new List <Spaceship.WeaponTypes>()
                {
                    Spaceship.WeaponTypes.Missiles
                },
                Crew     = Spaceship.CrewTypes.BadGuys,
                Name     = "Cylon Basestar",
                ImageUri = "https://upload.wikimedia.org/wikipedia/en/4/40/Battlestar_Galactica_intro.jpg"
            });
        }
Exemplo n.º 5
0
 private byte getSpawnChance(Spaceships enemy)
 {
     return(spawnChance[(byte)enemy]);
 }