Show More
Commit Description:
Hide budget for now....
Commit Description:
Hide budget for now. (grafted from c874f4993fc1575dc21b6d1a41b46dc9b87f3337)
Show/Diff file:
Action:
isometric-park-fna/Engines/SimulationBridgeEngine.cs
37 lines | 793 B | text/x-csharp | CSharpLexer
using Microsoft.Xna.Framework.Input;
using Encompass;
using isometricparkfna.Messages;
using isometricparkfna.Components;
namespace isometricparkfna.Engines {
// [Receives()]
[Reads(typeof(BudgetComponent))]
[Writes(typeof(BudgetComponent))]
class SimulationBridgeEngine : Engine
{
public Simulation simulation;
public SimulationBridgeEngine(Simulation simulation)
{
this.simulation = simulation;
}
public override void Update(double dt)
{
foreach (ref readonly var entity in ReadEntities<BudgetComponent>())
{
ref readonly var budgetComponent = ref GetComponent<BudgetComponent>(entity);
SetComponent(entity, new BudgetComponent{currentBudget = this.simulation.latestBudget,
priorBudget = this.simulation.previousBudget});
}
}
}
}