Пример #1
0
    public bool UpdateLabor(int change)
    {
        if (finances.DisplayFunds() < change * laborerHireCost && change > 0)
        {
            return(false);
        }

        laborers += change;

        if (change > 0)
        {
            finances.UpdateFunds(-change * laborerHireCost);
        }
        if (change < 0)
        {
            finances.UpdateFunds(-change * laborerHireCost / 2);
        }

        finances.UpdateExpenses(change * laborerCost);

        return(true);
    }
Пример #2
0
    public Workforce(int l, int r, int pc, int dc, Finances f, WorldPopulation wp)
    {
        laborers        = l;
        researchers     = r;
        planningCenters = pc;
        donationCenters = dc;
        finances        = f;
        worldPopulation = wp;

        int expenses = (l * laborerCost) + (r * researcherCost) + (pc * planningCenterCost);

        finances.UpdateExpenses(expenses);
    }