示例#1
0
        private IArmy CreateArmy(int cost)
        {
            IArmy army = ArmyGenerator.GenerateArmy(cost);

            List <IObserver> observers = new List <IObserver>()
            {
                new BeepObserver(),
                new FileObserver()
            };

            this.AddObservers(army, observers);
            return(army);
        }
    void GenerateMap()
    {
        map = new int[width, height];
        RandomFillMap();

        for (int i = 0; i < 5; i++)
        {
            SmoothMap();
        }

        ProcessMap();

        WaterGenerator waterGen = GetComponent <WaterGenerator>();

        waterGen.GenerateMap(map, squareSize);

        ArmyGenerator armyGen = GetComponent <ArmyGenerator>();

        armyGen.GenerateArmy(width, height, squareSize);
    }