Example #1
0
        public static Entity BuildLevel0Entity(IRandom rand, string designation)
        {
            var selection = rand.Next(4);

            switch (selection)
            {
            case 0:
                return(EntityBuilderEnemies.BuildRentACop(designation));

            case 1:
                return(EntityBuilderEnemies.BuildRentACopCowardly(designation));

            case 2:
                return(EntityBuilderEnemies.BuildRentACopBrave(designation));

            case 3:
                return(EntityBuilderEnemies.BuildRentACopBaton(designation));

            case 4:
                return(EntityBuilderEnemies.BuildRentACopBatonCowardly(designation));

            default:
                throw new InvalidOperationException();
            }
        }
Example #2
0
        public static Entity BuildLevel1Entity(IRandom rand, string designation)
        {
            var selection = rand.Next(6);

            switch (selection)
            {
            case 0:
                return(EntityBuilderEnemies.BuildPistolPoliceman(designation));

            case 1:
                return(EntityBuilderEnemies.BuildShotgunPoliceman(designation));

            case 2:
                return(EntityBuilderEnemies.BuildBraveShotgunPoliceman(designation));

            case 3:
                return(EntityBuilderEnemies.BuildRiflePoliceman(designation));

            case 4:
                return(EntityBuilderEnemies.BuildBraveShotgunPoliceman(designation));

            case 5:
                return(EntityBuilderEnemies.BuildPolicemanBruiser(designation));

            case 6:
                return(EntityBuilderEnemies.BuildPolicemanHeavy(designation));

            default:
                throw new InvalidOperationException();
            }
        }
Example #3
0
        public static Entity BuildLevel2Entity(IRandom rand, string designation)
        {
            var selection = rand.Next(4);

            switch (selection)
            {
            case 0:
                return(EntityBuilderEnemies.BuildSWATAssaultRifleman(designation));

            case 1:
                return(EntityBuilderEnemies.BuildBraveSWATAssaultRifleman(designation));

            case 2:
                return(EntityBuilderEnemies.BuildSWATMarksman(designation));

            case 3:
                return(EntityBuilderEnemies.BuildSWATRiotPolice(designation));

            case 4:
                return(EntityBuilderEnemies.BuildSWATShockPolice(designation));

            default:
                throw new InvalidOperationException();
            }
        }
Example #4
0
        public static Entity BuildRandomLevelledEntity(IRandom rand, string designation, int level)
        {
            switch (level)
            {
            case 0:
                return(EntityBuilderEnemies.BuildLevel0Entity(rand, designation));

            case 1:
                return(EntityBuilderEnemies.BuildLevel1Entity(rand, designation));

            case 2:
                return(EntityBuilderEnemies.BuildLevel2Entity(rand, designation));

            default:
                throw new InvalidOperationException();
            }
        }
Example #5
0
        public static ArenaState BuildArena(int width, int height, string mapID, Entity player, int level)
        {
            var           distributions = ArenaBuilder.levelDefinitions[level];
            List <Entity> mapEntities   = new List <Entity>()
            {
                player
            };
            var placementRand = new DotNetRandom(Int32.Parse(mapID));
            int d             = 0;

            foreach (var dist in distributions)
            {
                var numToAdd = placementRand.Next(dist.Min, dist.Max);
                for (int i = 0; i < numToAdd; i++)
                {
                    mapEntities.Add(EntityBuilderEnemies.BuildRandomLevelledEntity(placementRand, d.ToString(), dist.EntityLevel));
                    d++;
                }
            }
            return(ArenaBuilder.BuildArena(width, height, mapID, mapEntities, level));
        }