Esempio n. 1
0
        public FactoryAnthill(Field[,] map, int widthWorld, int heightWorld, AntQueen queen)
        {
            _queen = queen;
            FactoryAntQueen   factoryQueen      = new FactoryAntQueen();
            FactoryAntPicker  factoryAntPicker  = new FactoryAntPicker();
            FactoryFood       factoryFood       = new FactoryFood();
            FactoryAntFighter factoryAntFighter = new FactoryAntFighter();

            _heightWorld = heightWorld;
            _widthWorld  = widthWorld;
            _map         = map;
            _stackObjet  = new Stack();
            _stackAnt    = new Stack();
            _stackAnt.Push(queen ?? factoryQueen.CreateCharacter());
            for (var i = 0; i < 5; i++)
            {
                _stackAnt.Push(factoryAntFighter.CreateCharacter());
            }
            for (var i = 0; i < 20; i++)
            {
                _stackAnt.Push(factoryAntPicker.CreateCharacter());
            }
            for (var i = 0; i < 450; i++)
            {
                _stackObjet.Push(factoryFood.CreateObject());
            }
        }
Esempio n. 2
0
        public override AbstractCharacter CreateCharacter()
        {
            switch (RandInt(0, 50))
            {
            case 0:
                return(_factoryAntFighter.CreateCharacter());

            case 1:
                return(_factoryAntFighter.CreateCharacter());

            case 2:
                return(_factoryAntFighter.CreateCharacter());

            case 3:
                return(_factoryAntFighter.CreateCharacter());

            case 4:
                return(_factoryAntQueen.CreateCharacter());

            case 5:
                return(_factoryAntFighter.CreateCharacter());

            case 6:
                return(_factoryAntFighter.CreateCharacter());

            case 7:
                return(_factoryAntFighter.CreateCharacter());

            case 8:
                return(_factoryAntFighter.CreateCharacter());

            case 9:
                return(_factoryAntFighter.CreateCharacter());

            case 10:
                return(_factoryAntFighter.CreateCharacter());

            case 11:
                return(_factoryAntFighter.CreateCharacter());

            case 12:
                return(_factoryAntFighter.CreateCharacter());

            default:
                return(_factoryAntPicker.CreateCharacter());
            }
        }