update ReadMessages loops to use ref readonly
continuous-integration/drone/push Build is passing Details

pull/3/head
Evan Hemsley 2020-03-22 13:45:28 -07:00
parent cdc68e46e5
commit 971993f605
3 changed files with 14 additions and 14 deletions

View File

@ -26,7 +26,7 @@ namespace Tests
{ {
public override void Update(double dt) public override void Update(double dt)
{ {
foreach (var entityMessage in ReadMessages<EntityMessage>()) foreach (ref readonly var entityMessage in ReadMessages<EntityMessage>())
{ {
gottenMockComponent = GetComponent<MockComponent>(entityMessage.entity); gottenMockComponent = GetComponent<MockComponent>(entityMessage.entity);
} }
@ -207,7 +207,7 @@ namespace Tests
{ {
public override void Update(double dt) public override void Update(double dt)
{ {
foreach (var message in ReadMessages<AddMockComponentMessage>()) foreach (ref readonly var message in ReadMessages<AddMockComponentMessage>())
{ {
SetComponent(message.entity, message.mockComponent); SetComponent(message.entity, message.mockComponent);
} }
@ -280,7 +280,7 @@ namespace Tests
{ {
public override void Update(double dt) public override void Update(double dt)
{ {
foreach (var hasComponentTestEngine in ReadMessages<HasComponentTestMessage>()) foreach (ref readonly var hasComponentTestEngine in ReadMessages<HasComponentTestMessage>())
{ {
Assert.IsTrue(HasComponent<MockComponent>(hasComponentTestEngine.entity)); Assert.IsTrue(HasComponent<MockComponent>(hasComponentTestEngine.entity));
} }
@ -317,7 +317,7 @@ namespace Tests
{ {
public override void Update(double dt) public override void Update(double dt)
{ {
foreach (var hasComponentTestEngine in ReadMessages<HasComponentTestMessage>()) foreach (ref readonly var hasComponentTestEngine in ReadMessages<HasComponentTestMessage>())
{ {
hasComponentRuntimeTypeResult = HasComponent(hasComponentTestEngine.entity, typeof(MockComponent)); hasComponentRuntimeTypeResult = HasComponent(hasComponentTestEngine.entity, typeof(MockComponent));
} }
@ -379,7 +379,7 @@ namespace Tests
{ {
public override void Update(double dt) public override void Update(double dt)
{ {
foreach (var removeComponentMessage in ReadMessages<RemoveComponentTestMessage>()) foreach (ref readonly var removeComponentMessage in ReadMessages<RemoveComponentTestMessage>())
{ {
RemoveComponent<MockComponent>(removeComponentMessage.entity); RemoveComponent<MockComponent>(removeComponentMessage.entity);
} }
@ -424,7 +424,7 @@ namespace Tests
{ {
public override void Update(double dt) public override void Update(double dt)
{ {
foreach (var checkHasMockComponentMessage in ReadMessages<CheckHasMockComponentMessage>()) foreach (ref readonly var checkHasMockComponentMessage in ReadMessages<CheckHasMockComponentMessage>())
{ {
hasComponentResult = HasComponent<MockComponent>(checkHasMockComponentMessage.entity); hasComponentResult = HasComponent<MockComponent>(checkHasMockComponentMessage.entity);
} }
@ -473,7 +473,7 @@ namespace Tests
{ {
public override void Update(double dt) public override void Update(double dt)
{ {
foreach (var checkHasMockComponentMessage in ReadMessages<CheckHasMockComponentMessage>()) foreach (ref readonly var checkHasMockComponentMessage in ReadMessages<CheckHasMockComponentMessage>())
{ {
Assert.IsTrue(HasComponent<MockComponent>(checkHasMockComponentMessage.entity)); Assert.IsTrue(HasComponent<MockComponent>(checkHasMockComponentMessage.entity));
} }

View File

@ -683,7 +683,7 @@ namespace Tests
{ {
public override void Update(double dt) public override void Update(double dt)
{ {
foreach (var message in ReadMessages<DestroyComponentMessage>()) foreach (ref readonly var message in ReadMessages<DestroyComponentMessage>())
{ {
Destroy(message.entity); Destroy(message.entity);
} }
@ -879,7 +879,7 @@ namespace Tests
{ {
public override void Update(double dt) public override void Update(double dt)
{ {
foreach (var message in ReadMessages<MockMessage>()) foreach (ref readonly var message in ReadMessages<MockMessage>())
{ {
var entity = CreateEntity(); var entity = CreateEntity();
SetComponent(entity, new MockComponent { }); SetComponent(entity, new MockComponent { });

View File

@ -159,7 +159,7 @@ namespace Tests
{ {
public override void Update(double dt) public override void Update(double dt)
{ {
foreach (var setMessage in ReadMessages<SetMessage>()) foreach (ref readonly var setMessage in ReadMessages<SetMessage>())
{ {
SetComponent(setMessage.entity, new AComponent { myInt = 0 }); SetComponent(setMessage.entity, new AComponent { myInt = 0 });
} }
@ -173,7 +173,7 @@ namespace Tests
{ {
public override void Update(double dt) public override void Update(double dt)
{ {
foreach (var setMessage in ReadMessages<SetMessage>()) foreach (ref readonly var setMessage in ReadMessages<SetMessage>())
{ {
SetComponent(setMessage.entity, new AComponent { myInt = 1 }); SetComponent(setMessage.entity, new AComponent { myInt = 1 });
} }
@ -229,7 +229,7 @@ namespace Tests
{ {
public override void Update(double dt) public override void Update(double dt)
{ {
foreach (var setMessage in ReadMessages<SetMessage>()) foreach (ref readonly var setMessage in ReadMessages<SetMessage>())
{ {
SetComponent(setMessage.entity, new AComponent { myInt = 5 }); SetComponent(setMessage.entity, new AComponent { myInt = 5 });
} }
@ -244,7 +244,7 @@ namespace Tests
{ {
public override void Update(double dt) public override void Update(double dt)
{ {
foreach (var setMessage in ReadMessages<SetMessage>()) foreach (ref readonly var setMessage in ReadMessages<SetMessage>())
{ {
SetComponent(setMessage.entity, new AComponent { myInt = 1 }); SetComponent(setMessage.entity, new AComponent { myInt = 1 });
} }
@ -258,7 +258,7 @@ namespace Tests
{ {
public override void Update(double dt) public override void Update(double dt)
{ {
foreach (var setMessage in ReadMessages<SetMessage>()) foreach (ref readonly var setMessage in ReadMessages<SetMessage>())
{ {
SetComponent(setMessage.entity, new AComponent { myInt = 3 }); SetComponent(setMessage.entity, new AComponent { myInt = 3 });
} }