public void initializeUnitPriority(Nation player) { TopLevel aiTopLevel = player.getAI().GetTopLevel(); foreach (MyEnum.ArmyUnits unit in Enum.GetValues(typeof(MyEnum.ArmyUnits))) { if (MyEnum.ArmyUnits.infantry == unit) { aiTopLevel.setArmyUnitPriority(player, unit, 1.2f); } else { aiTopLevel.setArmyUnitPriority(player, unit, 1); } } }