Ejemplo n.º 1
0
    //just for AI
    public void initalizeFactoryPriorities(Nation player)
    {
        TopLevel aiTopLevel = player.getAI().GetTopLevel();

        foreach (MyEnum.Goods good in Enum.GetValues(typeof(MyEnum.Goods)))
        {
            aiTopLevel.setFactPriority(player, good, 1);
        }

        for (int i = 0; i < player.getProvinces().Count; i++)
        {
            int pIndex = player.getProvinces()[i];
            assemblyCsharp.Province prov = State.getProvinces()[pIndex];

            if (prov.getResource() == MyEnum.Resources.coal)
            {
                aiTopLevel.alterFactPriority(player, MyEnum.Goods.steel, 0.25f);
                aiTopLevel.alterFactPriority(player, MyEnum.Goods.parts, 0.15f);
                aiTopLevel.alterFactPriority(player, MyEnum.Goods.arms, 0.15f);
                aiTopLevel.alterFactPriority(player, MyEnum.Goods.chemicals, 0.2f);
            }
            if (prov.getResource() == MyEnum.Resources.cotton)
            {
                aiTopLevel.alterFactPriority(player, MyEnum.Goods.fabric, 0.25f);
                aiTopLevel.alterFactPriority(player, MyEnum.Goods.clothing, 0.2f);
                aiTopLevel.alterFactPriority(player, MyEnum.Goods.furniture, 0.1f);
            }

            if (prov.getResource() == MyEnum.Resources.dyes)
            {
                aiTopLevel.alterFactPriority(player, MyEnum.Goods.fabric, 0.25f);
                aiTopLevel.alterFactPriority(player, MyEnum.Goods.clothing, 0.2f);
            }

            if (prov.getResource() == MyEnum.Resources.iron)
            {
                aiTopLevel.alterFactPriority(player, MyEnum.Goods.steel, 0.25f);
                aiTopLevel.alterFactPriority(player, MyEnum.Goods.parts, 0.2f);
                aiTopLevel.alterFactPriority(player, MyEnum.Goods.arms, 0.2f);
                aiTopLevel.alterFactPriority(player, MyEnum.Goods.gear, 0.075f);
                aiTopLevel.alterFactPriority(player, MyEnum.Goods.auto, 0.075f);
                aiTopLevel.alterFactPriority(player, MyEnum.Goods.tank, 0.12f);
            }

            if (prov.getResource() == MyEnum.Resources.oil)
            {
                aiTopLevel.alterFactPriority(player, MyEnum.Goods.auto, 0.15f);
                aiTopLevel.alterFactPriority(player, MyEnum.Goods.fighter, 0.1f);
                aiTopLevel.alterFactPriority(player, MyEnum.Goods.tank, 0.1f);
            }
            if (prov.getResource() == MyEnum.Resources.rubber)
            {
                aiTopLevel.alterFactPriority(player, MyEnum.Goods.gear, 0.25f);
                aiTopLevel.alterFactPriority(player, MyEnum.Goods.telephone, 0.2f);
                aiTopLevel.alterFactPriority(player, MyEnum.Goods.auto, 0.12f);
                aiTopLevel.alterFactPriority(player, MyEnum.Goods.fighter, 0.075f);
                aiTopLevel.alterFactPriority(player, MyEnum.Goods.tank, 0.075f);
            }

            if (prov.getResource() == MyEnum.Resources.wood)
            {
                aiTopLevel.alterFactPriority(player, MyEnum.Goods.lumber, 0.25f);
                aiTopLevel.alterFactPriority(player, MyEnum.Goods.paper, 0.25f);
                aiTopLevel.alterFactPriority(player, MyEnum.Goods.furniture, 0.15f);
                aiTopLevel.alterFactPriority(player, MyEnum.Goods.telephone, 0.075f);
                aiTopLevel.alterFactPriority(player, MyEnum.Goods.fighter, 0.075f);
            }
        }
    }