public EconomicAttributes(Tangible Tangible, double LivingStandard) { _Supply = 0; _Demand = 0; _Coefficient = Tangible.Coefficient; _Exponent = Tangible.Exponent; _LivingStandard = LivingStandard; _Decay = Tangible.Decay; _IncomeReduction = 0; }
public double SupplyPrice(Tangible Tangible, double Amount) { if (_Market.ContainsKey(Tangible)) { return(_Market[Tangible].SupplyPrice(Amount, _Population)); } else { return(Double.PositiveInfinity); } }
private void AddTangibleIfNotExists(Tangible Tangible) { if (!_Market.ContainsKey(Tangible)) { if (Tangible is Resource) { _Market.Add(Tangible, new DepositAttributes(Tangible.Coefficient, Tangible.Exponent, Tangible.Decay, 0, 0, _LivingStandard)); } else { _Market.Add(Tangible, new EconomicAttributes(Tangible.Coefficient, Tangible.Exponent, Tangible.Decay, 0, 0, _LivingStandard)); } } }
public void AddTangible(string Name, Tangible Tangible) { _Tangibles.Add(Name.ToLower(), Tangible); }
public double FlowFrom(Tangible Tangible) { return(this[Tangible].Price(_Population) * this[Tangible].Supply); }
public double Price(Tangible Tangible) { return(this[Tangible].Price(_Population)); }
public EconomicAttributes this[Tangible Tangible] { get { AddTangibleIfNotExists(Tangible); return(_Market[Tangible]); } }
public void ChangeIncomeReduction(Tangible Tangible, double Delta) { AddTangibleIfNotExists(Tangible); _Market[Tangible].IncomeReduction += Delta; }
public void ChangeDemand(Tangible Tangible, double Delta) { AddTangibleIfNotExists(Tangible); _Market[Tangible].Demand += Delta; }
public void ChangeSupply(Tangible Tangible, double Delta) { AddTangibleIfNotExists(Tangible); _Market[Tangible].Supply += Delta; }