Example #1
0
        /// <summary>
        /// That is possible margin in that case. Includes tax. New value
        /// </summary>
        public Procent GetPossibleMargin(Province province)
        {
            var profit = getPossibleProfit(province);
            var taxes  = profit.Copy().multiply(province.GetCountry().taxationForRich.getTypedValue().tax);

            profit.subtract(taxes);
            return(new Procent(profit, GetBuildCost()));
        }
Example #2
0
        //internal Army getVirtualArmy(Procent howMuchShouldBeInSecondArmy)
        //{
        //    if (howMuchShouldBeInSecondArmy.get() == 1f)
        //    {
        //        return this;
        //        //this.personal.Clear();
        //    }
        //    else
        //    {
        //        Army secondArmy = new Army(this.getOwner());
        //        //Army sumArmy = new Army();
        //        //sumArmy.add(this);
        //        //this.joinin(secondArmy);
        //        int secondArmyExpectedSize = howMuchShouldBeInSecondArmy.getProcent(this.getSize());

        //        //secondArmy.clear();

        //        int needToFullFill = secondArmyExpectedSize;
        //        while (needToFullFill > 0)
        //        {
        //            var corpsToBalance = this.getBiggestCorpsSmallerThan(needToFullFill);
        //            if (corpsToBalance == null)
        //                break;
        //            else
        //                //this.move(corpsToBalance, secondArmy);
        //                secondArmy.add(new Corps(corpsToBalance));
        //            needToFullFill = secondArmyExpectedSize - secondArmy.getSize();
        //        }
        //        return secondArmy;
        //    }

        //}
        internal BattleResult attack(Province prov)
        {
            var enemy = prov.GetCountry();

            if (enemy == Country.NullCountry)
            {
                prov.mobilize();
            }
            else
            {
                enemy.mobilize(enemy.ownedProvinces);
            }
            enemy.consolidateArmies();
            return(attack(enemy.getDefenceForces()));
        }
Example #3
0
 virtual public Country GetCountry()
 {
     return(province.GetCountry());
 }
Example #4
0
 protected Producer(Province province) : base(province.GetCountry().getBank(), province)
 {
 }
Example #5
0
 public Country GetCountry()
 {
     return(Province.GetCountry());
 }