public Country(string iname, Culture iculture, CountryWallet wallet) : base(wallet) { government = new Government(this); economy = new Economy(this); serfdom = new Serfdom(this); minimalWage = new MinimalWage(this); unemploymentSubsidies = new UnemploymentSubsidies(this); taxationForPoor = new TaxationForPoor(this); taxationForRich = new TaxationForRich(this); name = iname; allCountries.Add(this); //countryTax = new Procent(0.1f); //TaxationForPoor.ReformValue hru = taxationForPoor.getValue() as TaxationForPoor.ReformValue; //countryTax = hru.tax; culture = iculture; //if (!Game.devMode) { government.status = Government.Aristocracy; economy.status = Economy.StateCapitalism; inventions.MarkInvented(InventionType.farming); inventions.MarkInvented(InventionType.manufactories); inventions.MarkInvented(InventionType.banking); // inventions.MarkInvented(InventionType.individualRights); serfdom.status = Serfdom.Abolished; } }
/// <summary> /// return procent of actual buying /// </summary> public Storage Consume(Producer forWhom, Storage need, CountryWallet subsidizer) { float actuallyNeedsFullfilled = 0f; //Storage actualConsumption; if (forWhom.wallet.CanAfford(need)) { actuallyNeedsFullfilled = DoFullBuying(forWhom, need); } else if (subsidizer == null) { actuallyNeedsFullfilled = DoPartialBuying(forWhom, need); } else { forWhom.province.owner.getCountryWallet().takeFactorySubsidies(forWhom, forWhom.wallet.HowMuchCanNotAfford(need)); //repeat attempt if (forWhom.wallet.CanAfford(need)) { actuallyNeedsFullfilled = DoFullBuying(forWhom, need); } else { actuallyNeedsFullfilled = DoPartialBuying(forWhom, need); } } return(new Storage(need.getProduct(), actuallyNeedsFullfilled)); }
internal void Buy(Factory buyer, PrimitiveStorageSet buying, CountryWallet subsidizer) { // Storage actualConsumption; foreach (Storage input in buying) { Consume(buyer, input, subsidizer); } }
public Wallet wallet; // = new Wallet(0f); public Owner(CountryWallet wallet) { this.wallet = wallet; }