Beispiel #1
0
        private void generateGamePreset()
        {
            Coordinates coord1  = new Coordinates(-12.3463, 457.534, -9042.0);
            Resources   res1    = new Resources(8, 1, 0);
            Planet      planet1 = new Planet("Tuchanka", coord1, res1);

            planet1.setColony("Krogans_shit");

            Coordinates coord2  = new Coordinates(63.1111, 684.425, 562.4);
            Resources   res2    = new Resources(1, 4, 12);
            Planet      planet2 = new Planet("Earth", coord2, res2);

            planet2.setColony("Tomsk");
            planet2.setColony("Moscow");

            Coordinates coord3  = new Coordinates(-257.89, 78.9235, 245.206);
            Resources   res3    = new Resources(2, 2, 8);
            Planet      planet3 = new Planet("Alpha Centauri 4", coord3, res3);

            planet3.setColony("no");

            this.planets = new List <Planet> {
                planet1, planet2, planet3
            };

            Dictionary <int, Resources> levels1 = new Dictionary <int, Resources> {
                [1] = new Resources(1, 1, 1),
                [2] = new Resources(2, 2, 2),
                [3] = new Resources(3, 3, 3)
            };

            Dictionary <int, Resources> levels2 = new Dictionary <int, Resources>
            {
                [1] = new Resources(2, 2, 2),
                [2] = new Resources(4, 4, 4),
                [3] = new Resources(6, 6, 6)
            };

            Dictionary <int, Resources> levels3 = new Dictionary <int, Resources>
            {
                [1] = new Resources(4, 4, 4),
                [2] = new Resources(8, 8, 8),
                [3] = new Resources(12, 12, 12)
            };

            MineType type1 = new MineType(levels1, "Small mine", new Resources(10, 10, 10), 3);
            MineType type2 = new MineType(levels1, "Medium mine", new Resources(50, 50, 50), 3);
            MineType type3 = new MineType(levels1, "Large mine", new Resources(100, 100, 100), 3);

            this.mineTypes = new List <MineType> {
                type1, type2, type3
            };
        }
Beispiel #2
0
        public void mineResources(Status status, Resources fertility)
        {
            MineType type = this.type as MineType;

            status.addResources(type.levels[this.level] * fertility);
        }