예제 #1
0
        //private static void calcBattles()
        //{
        //    foreach (Staff attacker in Staff.getAllStaffs().ToList())
        //    {
        //        foreach (var attackerArmy in attacker.getAttackingArmies().ToList())
        //        {
        //            var movement = attacker as Movement;
        //            if (movement == null || movement.isValidGoal()) // movements attack only if goal is still valid
        //            {
        //                var result = attackerArmy.attack(attackerArmy.getDestination());
        //                if (result.isAttackerWon())
        //                {
        //                    if (movement == null)
        //                        (attacker as Country).TakeProvince(attackerArmy.getDestination(), true);
        //                    //attackerArmy.getDestination().secedeTo(attacker as Country, true);
        //                    else
        //                    {
        //                        if (movement.getReformType() == null)//separatists
        //                            movement.onRevolutionWon();
        //                        else
        //                            movement.getReformType().setValue(movement.getGoal());

        //                    }
        //                }
        //                else if (result.isDefenderWon())
        //                {
        //                    if (movement != null)
        //                        movement.onRevolutionLost();
        //                }
        //                if (result.getAttacker() == Game.Player || result.getDefender() == Game.Player)
        //                    result.createMessage();
        //            }
        //            attackerArmy.sendTo(null); // go home
        //        }
        //        //attacker.consolidateArmies();
        //    }
        //}

        public static void prepareForNewTick()
        {
            AllMarkets.PerformAction(x => x.SetStatisticToZero());

            foreach (Country country in World.AllExistingCountries())
            {
                country.SetStatisticToZero();
                foreach (Province province in country.AllProvinces)
                {
                    foreach (var item in province.AllAgents)
                    {
                        item.SetStatisticToZero();
                    }
                }
            }
            PopType.sortNeeds(Market.TemporalSingleMarket);       //getAllExistingCountries().Random().market
            Product.sortSubstitutes(Market.TemporalSingleMarket); //getAllExistingCountries().Random().market
        }
예제 #2
0
 public static void prepareForNewTick()
 {
     Game.market.sentToMarket.setZero();
     foreach (Country country in Country.getAllExisting())
     {
         country.SetStatisticToZero();
         foreach (Province province in country.ownedProvinces)
         {
             province.BalanceEmployableWorkForce();
             {
                 foreach (var item in province.getAllAgents())
                 {
                     item.SetStatisticToZero();
                 }
             }
         }
     }
     PopType.sortNeeds();
     Product.sortSubstitutes();
 }