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)); } }
private float getColdArmsSupply() { if (Product.ColdArms.isInventedBy(getOwner().getPlaceDejure())) { return(Procent.makeProcent(getConsumption(Product.ColdArms), getNeeds(Product.ColdArms), false).get()); } else { return(0f); } }
private float getHorsesSupply() { if (getOwner().getPlaceDejure().isInvented(Invention.Domestication)) { return(Procent.makeProcent(getConsumption(Product.Cattle), getNeeds(Product.Cattle), false).get()); } else { return(0f); } }
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)); } }
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); } }
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); } }
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)); } }
/// <summary> /// That is possible margin in that case /// </summary> public Procent getMargin() { return(Procent.makeProcent(getPossibleProfit(), getInvestmentsCost())); }
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)); }
public Procent GetWorkForceFulFilling() { return(Procent.makeProcent(getWorkForce(), workForcePerLevel * level, false)); }