Esempio n. 1
0
 // Add or subtracts a resource by a given amount from the warehouse.
 public void ModifyWarehouseResource(GameManager.ResourceTypes resource, int amount)
 {
     _resourcesInWarehouse[resource] += amount;
 }
Esempio n. 2
0
    public override void InitializeBuilding(int index, Tile t)
    {
        _workers           = new List <Worker>();
        this._tile         = t;
        this._type         = (BuildingType)index + 1; // increment by 1 since the first item in BuildingType is Empty
        this._canBeBuiltOn = new List <Tile.TileTypes>();
        switch (this._type)
        {
        case BuildingType.Fishery:
            this._moneyCost   = 100;
            this._planksCost  = 2;
            this._upkeep      = 40;
            this._outputCount = 1;
            this._scalesWithNeighboringTiles = true;
            this._resourceGenerationInterval = 30f;
            this._canBeBuiltOn.Add(Tile.TileTypes.Sand);
            this._minNeighbors   = 1;
            this._maxNeighbors   = 3;
            this._inputResource  = GameManager.ResourceTypes.None;
            this._outputResource = GameManager.ResourceTypes.Fish;
            this._jobsCapacity   = 25;
            this._efficiency     = ComputeEfficiency();
            break;

        case BuildingType.Lumberjack:
            this._moneyCost   = 100;
            this._planksCost  = 0;
            this._upkeep      = 10;
            this._outputCount = 1;
            this._scalesWithNeighboringTiles = true;
            this._resourceGenerationInterval = 15f;
            this._canBeBuiltOn.Add(Tile.TileTypes.Forest);
            this._minNeighbors   = 1;
            this._maxNeighbors   = 6;
            this._inputResource  = GameManager.ResourceTypes.None;
            this._outputResource = GameManager.ResourceTypes.Wood;
            this._jobsCapacity   = 5;
            this._efficiency     = ComputeEfficiency();
            break;

        case BuildingType.Sawmill:
            this._moneyCost   = 100;
            this._planksCost  = 0;
            this._upkeep      = 10;
            this._outputCount = 2;
            this._efficiency  = 1f;
            this._scalesWithNeighboringTiles = false;
            this._resourceGenerationInterval = 15f;
            this._canBeBuiltOn.Add(Tile.TileTypes.Grass);
            this._canBeBuiltOn.Add(Tile.TileTypes.Forest);
            this._canBeBuiltOn.Add(Tile.TileTypes.Stone);
            this._inputResource  = GameManager.ResourceTypes.Wood;
            this._outputResource = GameManager.ResourceTypes.Planks;
            this._jobsCapacity   = 10;
            break;

        case BuildingType.SheepFarm:
            this._moneyCost   = 100;
            this._planksCost  = 2;
            this._upkeep      = 20;
            this._outputCount = 1;
            this._scalesWithNeighboringTiles = true;
            this._resourceGenerationInterval = 30f;
            this._canBeBuiltOn.Add(Tile.TileTypes.Grass);
            this._minNeighbors   = 1;
            this._maxNeighbors   = 4;
            this._inputResource  = GameManager.ResourceTypes.None;
            this._outputResource = GameManager.ResourceTypes.Wood;
            this._jobsCapacity   = 10;
            this._efficiency     = ComputeEfficiency();
            break;

        case BuildingType.FrameworkKnitters:
            this._moneyCost   = 400;
            this._planksCost  = 2;
            this._upkeep      = 50;
            this._outputCount = 1;
            this._efficiency  = 1f;
            this._scalesWithNeighboringTiles = false;
            this._resourceGenerationInterval = 30f;
            this._canBeBuiltOn.Add(Tile.TileTypes.Grass);
            this._canBeBuiltOn.Add(Tile.TileTypes.Forest);
            this._canBeBuiltOn.Add(Tile.TileTypes.Stone);
            this._inputResource  = GameManager.ResourceTypes.Wood;
            this._outputResource = GameManager.ResourceTypes.Clothes;
            this._jobsCapacity   = 50;
            break;

        case BuildingType.PotatoFarm:
            this._moneyCost   = 100;
            this._planksCost  = 2;
            this._upkeep      = 20;
            this._outputCount = 1;
            this._scalesWithNeighboringTiles = true;
            this._resourceGenerationInterval = 30f;
            this._canBeBuiltOn.Add(Tile.TileTypes.Grass);
            this._minNeighbors   = 1;
            this._maxNeighbors   = 4;
            this._inputResource  = GameManager.ResourceTypes.None;
            this._outputResource = GameManager.ResourceTypes.Potato;
            this._jobsCapacity   = 20;
            this._efficiency     = ComputeEfficiency();
            break;

        case BuildingType.SchnappsDistillery:
            this._moneyCost   = 100;
            this._planksCost  = 2;
            this._upkeep      = 40;
            this._outputCount = 1;
            this._efficiency  = 1f;
            this._scalesWithNeighboringTiles = false;
            this._resourceGenerationInterval = 30f;
            this._canBeBuiltOn.Add(Tile.TileTypes.Grass);
            this._canBeBuiltOn.Add(Tile.TileTypes.Forest);
            this._canBeBuiltOn.Add(Tile.TileTypes.Stone);
            this._inputResource  = GameManager.ResourceTypes.Potato;
            this._outputResource = GameManager.ResourceTypes.Schnapps;
            this._jobsCapacity   = 50;
            break;
        }
        this._jobManager = JobManager.Instance;
        PopulateJobs();
    }