Exemplo n.º 1
0
    public void adjustDevelopmentPriorityInLightOfPotential(Nation player)
    {
        if (player.getIP() < 1 && State.era == MyEnum.Era.Early)
        {
            if (PlayerCalculator.canMakeDevelopmentAction(player))
            {
                PlayerPayer.payForDevelopmentAction(player, 1);
                player.addIP(2);
            }
            else
            {
                this.progressPriorities[MyEnum.progressPriorities.investment]++;
            }
        }

        if (player.getIP() < 2 && State.era != MyEnum.Era.Early)
        {
            if (PlayerCalculator.canMakeDevelopmentAction(player))
            {
                PlayerPayer.payForDevelopmentAction(player, 1);
                player.addIP(2);
            }
            else
            {
                this.progressPriorities[MyEnum.progressPriorities.investment]++;
            }
        }
    }
Exemplo n.º 2
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;
        }
    }
Exemplo n.º 3
0
    private void updateDoctrinePanel(Nation player)
    {
        int        rowIndex   = 0;
        LandForces landForces = player.landForces;

        foreach (MyEnum.ArmyDoctrines doctrine in Enum.GetValues(typeof(MyEnum.ArmyDoctrines)))
        {
            TableRow row = doctrineTable.Rows[rowIndex];

            Button addButton = row.Cells[3].GetComponentInChildren <Button>();

            if (landForces.hasDoctrine(doctrine))
            {
                Toggle toggle = row.GetComponentInChildren <Toggle>();
                toggle.isOn            = true;
                addButton.interactable = false;
            }
            if (PlayerCalculator.canMakeDevelopmentAction(player) == false)
            {
                addButton.interactable = false;
            }
            rowIndex++;
        }
    }