Spawner.Spawn now requires in param #13

Merged
cosmonaut merged 1 commits from SpawnerIn into main 2020-07-22 01:07:18 +00:00
2 changed files with 3 additions and 3 deletions

View File

@ -21,12 +21,12 @@ namespace Encompass
public override void Update(double dt) public override void Update(double dt)
{ {
foreach (var message in ReadMessages<TMessage>()) foreach (ref readonly var message in ReadMessages<TMessage>())
{ {
Spawn(message); Spawn(message);
} }
} }
protected abstract void Spawn(TMessage message); protected abstract void Spawn(in TMessage message);
} }
} }

View File

@ -23,7 +23,7 @@ namespace Tests
[Writes(typeof(TestComponent))] [Writes(typeof(TestComponent))]
class TestSpawner : Spawner<SpawnMessageA> class TestSpawner : Spawner<SpawnMessageA>
{ {
protected override void Spawn(SpawnMessageA message) protected override void Spawn(in SpawnMessageA message)
{ {
resultEntity = CreateEntity(); resultEntity = CreateEntity();
SetComponent(resultEntity, new TestComponent()); SetComponent(resultEntity, new TestComponent());