Exemplo n.º 1
0
    public static QGameState buyBuilding(QGameState qGS, IBuilding newBuilding)
    {
        BuildingGS newGameState = waitGameState(qGS.gameState, newBuilding.timeToBuild());

        newGameState.buyBuilding(newBuilding);

        int  costToGetHere = qGS.costToGetHere + newBuilding.timeToBuild();
        Work newWork       = new Work(EWork.BuildBuilding, newBuilding.getBuildingType(), newBuilding.timeToBuild());

        return(new QGameState(newGameState, qGS, newWork, costToGetHere));
    }