Exemplo n.º 1
0
    public void ThatFillInData(assemblyCsharp.Province province)
    {
        this.Name.text = province.getProvName();
        string resource = province.getResource().ToString();

        Sprite newResourceSprite = Resources.Load("Resource/" + resource, typeof(Sprite)) as Sprite;

        this.Resource.sprite         = newResourceSprite;
        this.Resource.preserveAspect = true;
        Debug.Log("You f****r...." + province.getProduction().ToString());
        this.Produces.text      = "Produces " + province.getProduction().ToString("0.0") + " " + resource + " /turn";
        this.RailroadLevel.text = province.getInfrastructure().ToString();
        this.FortLevel.text     = province.getFortLevel().ToString();
        this.Culture.text       = "Culture: " + province.culture;
        // this.resourceText.text = "Province produces " + resource;
        string nation = province.getOwner().ToString();

        Debug.Log("Owner: " + nation);
        this.DevelopmentLevel.text = province.getDevelopmentLevel().ToString();
        this.NationName.text       = nation;
        //text.text = "Province produces " + Resource;
        this.Flag.sprite = Resources.Load("Flags/" + province.getOwner().ToString(), typeof(Sprite)) as Sprite;
        pickProductionPicture(province);
        // Text flagText = FlagTip.GetComponentInChildren<Text>();
        // Debug.Log("Flag text: " + flagText.text);
        // flagText.text = Owner;
        //flagTip.GetComponent<Text>().text = nation;
    }
Exemplo n.º 2
0
    private void distributeStartingResourcesAndGoods(Nation player)
    {
        for (int i = 0; i < player.getProvinces().Count; i++)
        {
            int index = player.getProvinceIndex(i);
            assemblyCsharp.Province prov = State.getProvinces()[index];
            MyEnum.Resources        res  = prov.getResource();
            float amount = prov.getProduction();
            if (res == MyEnum.Resources.gold)
            {
                player.receiveGold(amount * 5);
            }
            else
            {
                player.collectResource(res, amount);
            }
            player.addRuralPOP();
            player.addRuralPOP();
        }

        player.receiveGold(5);

        if (player.getType() == MyEnum.NationType.major)
        {
            player.collectGoods(MyEnum.Goods.steel, 1);
            player.collectGoods(MyEnum.Goods.fabric, 1);
            player.collectGoods(MyEnum.Goods.lumber, 1);
            player.collectGoods(MyEnum.Goods.arms, 2);

            player.collectResource(MyEnum.Resources.wheat, 1);
            player.collectResource(MyEnum.Resources.meat, 0.5f);
            player.collectResource(MyEnum.Resources.fruit, 0.5f);
            player.receiveGold(5);
        }
    }
Exemplo n.º 3
0
    public void ThisFillInData(assemblyCsharp.Province province)
    {
        this.Name.text = province.getProvName();
        string resource          = province.getResource().ToString();
        Sprite newResourceSprite = Resources.Load("Resource/" + resource, typeof(Sprite)) as Sprite;

        this.Resource.sprite         = newResourceSprite;
        this.Resource.preserveAspect = true;

        this.Produces.text      = "Produces " + province.getProduction().ToString("0.0") + " " + resource + " /turn";
        this.RailroadLevel.text = province.getInfrastructure().ToString();
        this.FortLevel.text     = province.getFortLevel().ToString();
        this.Culture.text       = "Culture: " + province.culture;
        // this.resourceText.text = "Province produces " + resource;
        // Text text = ResourceTip.GetComponentInChildren<Text>();
        // text.text =  "Province produces " + Resource;
        pickProductionPicture(province);

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

        updateSelfProvinceButtons(player, province);
    }
Exemplo n.º 4
0
    private static void collectResources(Nation player)
    {
        for (int i = 0; i < player.getProvinces().Count; i++)
        {
            int index = player.getProvinces()[i];
            assemblyCsharp.Province prov = State.getProvinces()[index];
            float            resYield    = prov.getProduction();
            MyEnum.Resources res         = prov.getResource();
            Debug.Log("prov res: " + res);
            if (res != MyEnum.Resources.gold)
            {
                player.collectResource(res, resYield);
            }
            else
            {
                player.receiveGold(resYield * 5);
            }
        }

        for (int i = 0; i < player.getColonies().Count; i++)
        {
            int index = player.getColonies()[i];
            assemblyCsharp.Province prov = State.getProvinces()[index];
            float            resYield    = prov.getProduction();
            MyEnum.Resources res         = prov.getResource();
            player.collectResource(res, resYield);
        }
    }