예제 #1
0
    void ITurnWaiter.NewTurn()
    {
        producingProgress += GetStatistic("Production");
        IProducible producible = (IProducible)producing;

        if (producible != null && producingProgress >= producible.CostInProduction())
        {
            if (producing is Unit)
            {
                var newUnit = GameManager.PlaceUnit(producing.name, Tile, Nation);
                unitObjects.Add(newUnit);
            }
            else if (producing is Building)
            {
                buildings.Add(producing.name);
            }

            producingProgress = 0;
            producing         = null;
        }

        cityLevelProgress += GetStatistic("Food");
        if (cityLevelProgress >= LevelProgressRequired)
        {
            cityLevelProgress = 0;
            cityLevel++;
            Expand();
        }
    }
예제 #2
0
    internal override string GetStats()
    {
        string stats = "";

        if (producing)
        {
            IProducible producible = (IProducible)producing;
            if (producible != null)
            {
                int turnsLeft = Mathf.CeilToInt((producible.CostInProduction() - producingProgress) / (float)GetStatistic("Production"));
                stats = "Producing " + producing.name + " (" + turnsLeft + " turn(s) left)";
            }
            else
            {
                stats = "Producing " + producing.name;
            }
        }

        if (stats != "")
        {
            stats += "\n";
        }

        stats += "Gold +" + GetStatistic("Gold");
        stats += "\n";
        stats += "Science +" + GetStatistic("Science");
        stats += "\n";
        stats += "Production +" + GetStatistic("Production");
        stats += "\n";
        stats += "Food +" + GetStatistic("Food");

        return(stats);
    }