Spawner.Spawn now requires in param
parent
1d458e3563
commit
d661ed5b17
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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());
|
||||||
|
|
Loading…
Reference in New Issue