public new IBuilding deepClone(BuildingGS newGS)
    {
        PositionDependentBuilding result = this.clone(newGS);

        result.currentWorkerCount = this.currentWorkerCount;
        return(result);
    }
Exemplo n.º 2
0
    public bool canBuyBuilding(IBuilding possibleBuilding)
    {
        // TODO: in the future, buildings may cost differently depending on where they're built etc.
        bool result = canAffordBuilding(possibleBuilding.getBuildingType()); // Stockpile considerations

        result &= canAffordUpkeep(possibleBuilding);                         // per tick upkeep considerations

        PositionDependentBuilding posBuilding = possibleBuilding as PositionDependentBuilding;

        if (posBuilding != null)
        {
            // Can the provided building be built in this game state?
            result &= posBuilding.canBuild(this);
        }
        return(result);
    }