Esempio n. 1
0
    private void updateDevelopmentPanel(Nation player)
    {
        currentAP.text         = player.getAP().ToString();
        currentPP.text         = player.getDP().ToString();
        currentResearch.text   = player.Research.ToString();
        currentInvestment.text = player.IP.ToString();
        currentStability.text  = player.Stability.ToString();

        if (PlayerCalculator.canAddAP(player))
        {
            addAPButton.interactable = true;
        }
        else
        {
            addAPButton.interactable = false;
        }


        if (PlayerCalculator.canAddDP(player))
        {
            addDPButton.interactable = true;
        }
        else
        {
            addDPButton.interactable = false;
        }

        if (PlayerCalculator.canMakeDevelopmentAction(player) == true)
        {
            Debug.Log("Can Make Development Action");
            fundResearch.interactable      = true;
            fundCulture.interactable       = true;
            capitalInvestment.interactable = true;
            increaseStability.interactable = true;
        }
        else
        {
            Debug.Log("Cannot Make Development Action");
            fundResearch.interactable      = false;
            fundCulture.interactable       = false;
            capitalInvestment.interactable = false;
            increaseStability.interactable = false;
        }
    }
    public void controlToolTip()
    {
        toolTipTrigger = this.GetComponent <TooltipTrigger>();

        Debug.Log("Mouse Over Here");
        Debug.Log(toolTipTrigger.name);

        App    app         = UnityEngine.Object.FindObjectOfType <App>();
        int    playerIndex = app.GetHumanIndex();
        Nation player      = State.getNations()[playerIndex];

        if (PlayerCalculator.canAddDP(player))
        {
            toolTipTrigger.SetText("BodyText", "Press to gain more Development Points (DP)");
        }
        else
        {
            string message = "You requre ";

            if (player.getNumberResource(MyEnum.Resources.spice) < 1)
            {
                message += " 1 more spice ";
            }
            if (player.getNumberGood(MyEnum.Goods.paper) < 1)
            {
                message += " 1 more paper ";
            }

            if (player.getNumberGood(MyEnum.Goods.furniture) < 1)
            {
                message += " 1 more furniture ";
            }
            // StringBuilder requirements = new StringBuilder();

            message += ".";

            toolTipTrigger.SetText("BodyText", message);
        }
    }