Exemplo n.º 1
0
        public override void CreateInstance(int x, int y, ResourcesManager resources, Map map)
        {
            if (!resources.CheckResourcesNeeded(this))
            {
                throw new ArgumentException("Ressources manquantes.");
            }

            resources.UpdateWhenCreate(this);
            Building building = new CityHall(this, x, y);

            map.AddBuilding(x, y, building);
            _list.Add(building);
        }
        public override void CreateInstance(int x, int y, ResourcesManager resources, Map map)
        {
            if (!resources.CheckResourcesNeeded(this))
            {
                throw new ArgumentException("Ressources manquantes.");
            }

            resources.UpdateWhenCreate(this);
            Building building = new Warehouse(this, x, y);

            map.AddBuilding(x, y, building);
            _list.Add(building);
            _maxMetalCapacity += _metalCapacity;
            _maxWoodCapacity  += _woodCapacity;
            _maxRockCapacity  += RockCapacity;
        }