Ejemplo n.º 1
0
    public void UpdateResourcesDisplayed()
    {
        GoldQuantity.text    = currentGold.ToString();
        diamondQuantity.text = numberOfDiamondsOwned.ToString();
        currentWeek.text     = GameSystem.instance.currentWeek.ToString();
        miningShaft.UpdateExpectedExpenditure(CalculateAllMinersSalary());
        //deliveryDiamondQuantity.text = "Deliver " + gameSystem.goalDiamondQuantity.ToString() + " Diamonds";
        deliveryDiamondQuantity.text = GameSystem.instance.goalDiamondQuantity.ToString();

        int weeksLeft = GameSystem.instance.goalWeek - GameSystem.instance.currentWeek;

        if (weeksLeft <= 1)
        {
            foreach (Text childText in deliveryWeeksLeft.gameObject.GetComponentsInChildren <Text>())
            {
                if (childText != deliveryWeeksLeft)
                {
                    childText.gameObject.SetActive(false);
                }
            }
            deliveryWeeksLeft.text = "after this week!";
        }
        else
        {
            foreach (Text childText in deliveryWeeksLeft.gameObject.GetComponentsInChildren <Text>(true))
            {
                childText.gameObject.SetActive(true);
            }
            deliveryWeeksLeft.text = weeksLeft.ToString();
        }
    }
Ejemplo n.º 2
0
 public void HireMiner(MiningShaft thisMiningShaft)
 {
     if (CheckAffordability(hireMinerCost))
     {
         thisMiningShaft.AddWorker();
         thisMiningShaft.UpdateExpectedExpenditure(CalculateAllMinersSalary());
     }
 }
Ejemplo n.º 3
0
    public void UpdateStatus()
    {
        if (numberOfTurnsStriking > 0)
        {
            numberOfTurnsStriking--;
            StrikeIndicator.gameObject.SetActive(true);
            StrikeIndicator.GetComponentInChildren <Text>().text = ("Striking " + numberOfTurnsStriking);
            StudyIndicator.gameObject.SetActive(false);
            HurtIndicator.gameObject.SetActive(false);
        }
        if (numberOfTurnsStudying > 0)
        {
            numberOfTurnsStudying--;
            StudyIndicator.gameObject.SetActive(true);
            StudyIndicator.GetComponentInChildren <Text>().text = ("Studying " + numberOfTurnsStudying);
            StrikeIndicator.gameObject.SetActive(false);
            HurtIndicator.gameObject.SetActive(false);
        }
        if (numberOfTurnsHurt > 0)
        {
            numberOfTurnsHurt--;
            HurtIndicator.gameObject.SetActive(true);
            HurtIndicator.GetComponentInChildren <Text>().text = ("Hurt " + numberOfTurnsHurt);
            StudyIndicator.gameObject.SetActive(false);
            StrikeIndicator.gameObject.SetActive(false);
        }
        if (numberOfTurnsStudying == 0 && numberOfTurnsStriking == 0 && numberOfTurnsHurt == 0)
        {
            minerStatus = Status.Active;
            StudyIndicator.gameObject.SetActive(false);
            StrikeIndicator.gameObject.SetActive(false);
            HurtIndicator.gameObject.SetActive(false);
        }

        miningShaft.UpdateExpectedExpenditure(resourceManager.CalculateAllMinersSalary());
    }