diff --git a/isometric-park-fna/Engines/SimulationBridgeEngine.cs b/isometric-park-fna/Engines/SimulationBridgeEngine.cs --- a/isometric-park-fna/Engines/SimulationBridgeEngine.cs +++ b/isometric-park-fna/Engines/SimulationBridgeEngine.cs @@ -103,26 +103,33 @@ } } + #region calculate_entry + int new_visitor_count = 0; foreach (ref readonly var entity in ReadEntities()) { var entry_policy_component = GetComponent(entity); if (entry_policy_component.PrimaryEntryPolicy == EntryPolicy.EntryFee) { - new_entry_fees = (decimal)(this.simulation.visitor_count * entry_policy_component.PrimaryEntryFee); + // + new_visitor_count = max(0, (int)((this.simulation.map.tree_count / 11) * ((10.00M -entry_policy_component.PrimaryEntryFee) / 10.00M))); + new_entry_fees = (decimal)(new_visitor_count * entry_policy_component.PrimaryEntryFee); } else if (entry_policy_component.PrimaryEntryPolicy == EntryPolicy.Free) { + new_visitor_count = (this.simulation.map.tree_count / 11); new_entry_fees = 0M; } else { - new_entry_fees = (decimal)(this.simulation.visitor_count * 0.1 * 2.00); + new_visitor_count = (this.simulation.map.tree_count / 11); + var donor_count = max(0, (int)(new_visitor_count * ((10.00M -entry_policy_component.PrimaryEntryFee) / 10.00M))); + new_entry_fees = (decimal)(donor_count * entry_policy_component.PrimaryEntryFee); Logging.Spy(new {visitor_count = this.simulation.visitor_count, new_entry_fees = new_entry_fees}); } - + this.simulation.visitor_count = new_visitor_count; // new_entry_fees = } diff --git a/isometric-park-fna/Simulation.cs b/isometric-park-fna/Simulation.cs --- a/isometric-park-fna/Simulation.cs +++ b/isometric-park-fna/Simulation.cs @@ -359,7 +359,7 @@ } } - this.visitor_count = this.map.tree_count / 10; + // this.visitor_count = this.map.tree_count / 10; Budget newBudget = new Budget {