예제 #1
0
        public Procent getRelativeStrength(Staff toWhom)
        {
            //var governmentHomeArmy = country.getDefenceForces();
            // Movement isToWhomMovement = toWhom as Movement;
            var thisStrenght = getStrengthExluding(toWhom); // null or not null

            // Movement isThisMovement = this as Movement;
            var toWhomStrenght = toWhom.getStrengthExluding(this);// null or not null

            if (toWhomStrenght == 0f)
            {
                if (thisStrenght == 0f)
                {
                    return(Procent.ZeroProcent);
                }
                else
                {
                    return(Procent.Max999);
                }
            }
            else
            {
                return(Procent.makeProcent(thisStrenght, toWhomStrenght));
            }
        }
예제 #2
0
 private float getColdArmsSupply()
 {
     if (Product.ColdArms.isInventedBy(getOwner().getPlaceDejure()))
     {
         return(Procent.makeProcent(getConsumption(Product.ColdArms), getNeeds(Product.ColdArms), false).get());
     }
     else
     {
         return(0f);
     }
 }
예제 #3
0
 private float getHorsesSupply()
 {
     if (getOwner().getPlaceDejure().isInvented(Invention.Domestication))
     {
         return(Procent.makeProcent(getConsumption(Product.Cattle), getNeeds(Product.Cattle), false).get());
     }
     else
     {
         return(0f);
     }
 }
예제 #4
0
        public Procent getWorldProductionShare(Product product)
        {
            var worldProduction = Game.market.getProductionTotal(product, true);

            if (worldProduction.isZero())
            {
                return(Procent.ZeroProcent);
            }
            else
            {
                return(Procent.makeProcent(getProducedTotal(product), worldProduction));
            }
        }
예제 #5
0
 private float getEquippedCarsSupply()
 {
     if (Product.Cars.isInventedBy(getOwner().getPlaceDejure()))
     {
         return(Mathf.Min(
                    Procent.makeProcent(getConsumption(Product.Cars), getNeeds(Product.Cars), false).get(),
                    Procent.makeProcent(getConsumption(Product.MotorFuel), getNeeds(Product.MotorFuel), false).get()
                    ));
     }
     else
     {
         return(0f);
     }
 }
예제 #6
0
 private float getEquippedArtillerySupply()
 {
     if (Product.Artillery.isInventedBy(getOwner().getPlaceDejure()))
     {
         return(Mathf.Min(
                    Procent.makeProcent(getConsumption(Product.Artillery), getNeeds(Product.Artillery), false).get(),
                    Procent.makeProcent(getConsumption(Product.Ammunition), getNeeds(Product.Ammunition), false).get()
                    ));
     }
     else
     {
         return(0f);
     }
 }
예제 #7
0
 public Procent getMargin()
 {
     if (getCountry().economy.getValue() == Economy.PlannedEconomy || !isWorking())
     {
         return(Procent.ZeroProcent);
     }
     else
     {
         var divider = Game.market.getCost(getUpgradeNeeds()).get() * level;
         if (divider == 0f)
         {
             Debug.Log("Division by zero in getMargin()");
         }
         return(Procent.makeProcent(getProfit(), divider, false));
     }
 }
예제 #8
0
 /// <summary>
 /// That is possible margin in that case
 /// </summary>
 public Procent getMargin()
 {
     return(Procent.makeProcent(getPossibleProfit(), getInvestmentsCost()));
 }
예제 #9
0
 internal Procent getConsumptionProcent(Product product, Country country)
 {
     // getBiggestStorage here are duplicated in this.consume() (convertToBiggestStorageProduct())
     return(Procent.makeProcent(consumption.getBiggestStorage(product), getRealNeeds(country, product), false));
 }
예제 #10
0
 public Procent GetWorkForceFulFilling()
 {
     return(Procent.makeProcent(getWorkForce(), workForcePerLevel * level, false));
 }