2019-06-15 00:51:06 +00:00
|
|
|
using NUnit.Framework;
|
2019-06-17 18:33:38 +00:00
|
|
|
using FluentAssertions;
|
2019-06-15 00:51:06 +00:00
|
|
|
|
|
|
|
using Encompass;
|
2019-06-17 18:33:38 +00:00
|
|
|
|
2019-06-15 01:13:24 +00:00
|
|
|
using System;
|
2019-06-17 18:33:38 +00:00
|
|
|
using System.Linq;
|
|
|
|
using System.Collections.Generic;
|
2019-06-15 00:51:06 +00:00
|
|
|
|
2019-06-15 19:32:56 +00:00
|
|
|
namespace Tests
|
|
|
|
{
|
2019-06-15 00:51:06 +00:00
|
|
|
public class EngineTest
|
|
|
|
{
|
2019-06-17 18:33:38 +00:00
|
|
|
static List<KeyValuePair<Guid, MockComponent>> resultComponents;
|
2019-06-15 18:40:42 +00:00
|
|
|
static MockComponent resultComponent;
|
2019-06-15 00:51:06 +00:00
|
|
|
|
2019-06-17 01:03:57 +00:00
|
|
|
static List<MockMessage> resultMessages;
|
2019-06-16 01:55:35 +00:00
|
|
|
|
2019-06-15 01:13:24 +00:00
|
|
|
public class ReadComponentsTestEngine : Engine
|
2019-06-15 00:51:06 +00:00
|
|
|
{
|
|
|
|
public override void Update(float dt)
|
|
|
|
{
|
2019-06-17 18:33:38 +00:00
|
|
|
resultComponents = this.ReadComponents<MockComponent>().ToList();
|
2019-06-15 00:51:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-15 01:13:24 +00:00
|
|
|
public class ReadComponentTestEngine : Engine
|
|
|
|
{
|
|
|
|
public override void Update(float dt)
|
|
|
|
{
|
2019-06-17 18:33:38 +00:00
|
|
|
resultComponent = this.ReadComponent<MockComponent>().Value;
|
2019-06-15 01:13:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-15 00:51:06 +00:00
|
|
|
[Test]
|
|
|
|
public void ReadComponents()
|
|
|
|
{
|
|
|
|
var worldBuilder = new WorldBuilder();
|
2019-06-15 01:13:24 +00:00
|
|
|
worldBuilder.AddEngine<ReadComponentsTestEngine>();
|
2019-06-15 00:51:06 +00:00
|
|
|
|
|
|
|
var entity = worldBuilder.CreateEntity();
|
|
|
|
|
|
|
|
MockComponent mockComponent;
|
|
|
|
mockComponent.myInt = 0;
|
|
|
|
mockComponent.myString = "hello";
|
|
|
|
|
|
|
|
MockComponent mockComponentB;
|
|
|
|
mockComponentB.myInt = 1;
|
|
|
|
mockComponentB.myString = "howdy";
|
|
|
|
|
2019-06-17 18:33:38 +00:00
|
|
|
var componentAID = entity.AddComponent(mockComponent);
|
|
|
|
var componentBID = entity.AddComponent(mockComponentB);
|
2019-06-15 00:51:06 +00:00
|
|
|
|
|
|
|
var world = worldBuilder.Build();
|
|
|
|
|
|
|
|
world.Update(0.01f);
|
|
|
|
|
2019-06-17 18:33:38 +00:00
|
|
|
var resultComponentValues = resultComponents.Select((kv) => kv.Value);
|
|
|
|
resultComponentValues.Should().Contain(mockComponent);
|
|
|
|
resultComponentValues.Should().Contain(mockComponentB);
|
2019-06-15 00:51:06 +00:00
|
|
|
}
|
2019-06-15 01:13:24 +00:00
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void ReadComponent()
|
|
|
|
{
|
|
|
|
var worldBuilder = new WorldBuilder();
|
|
|
|
worldBuilder.AddEngine<ReadComponentTestEngine>();
|
|
|
|
|
|
|
|
var entity = worldBuilder.CreateEntity();
|
|
|
|
|
|
|
|
MockComponent mockComponent;
|
|
|
|
mockComponent.myInt = 0;
|
|
|
|
mockComponent.myString = "hello";
|
|
|
|
|
|
|
|
entity.AddComponent(mockComponent);
|
|
|
|
|
|
|
|
var world = worldBuilder.Build();
|
|
|
|
|
|
|
|
world.Update(0.01f);
|
|
|
|
|
2019-06-15 18:40:42 +00:00
|
|
|
Assert.AreEqual(mockComponent, resultComponent);
|
2019-06-15 01:13:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void ReadComponentWhenMultipleComponents()
|
|
|
|
{
|
|
|
|
var worldBuilder = new WorldBuilder();
|
|
|
|
worldBuilder.AddEngine<ReadComponentTestEngine>();
|
|
|
|
|
|
|
|
var entity = worldBuilder.CreateEntity();
|
|
|
|
|
|
|
|
MockComponent mockComponent;
|
|
|
|
mockComponent.myInt = 0;
|
|
|
|
mockComponent.myString = "hello";
|
|
|
|
|
|
|
|
MockComponent mockComponentB;
|
|
|
|
mockComponentB.myInt = 1;
|
|
|
|
mockComponentB.myString = "howdy";
|
|
|
|
|
|
|
|
entity.AddComponent(mockComponent);
|
|
|
|
entity.AddComponent(mockComponentB);
|
|
|
|
|
|
|
|
var world = worldBuilder.Build();
|
|
|
|
|
|
|
|
Assert.Throws<InvalidOperationException>(() => world.Update(0.01f));
|
|
|
|
}
|
2019-06-15 07:39:08 +00:00
|
|
|
|
|
|
|
[Mutates(typeof(MockComponent))]
|
|
|
|
public class UpdateComponentTestEngine : Engine
|
|
|
|
{
|
|
|
|
public override void Update(float dt)
|
|
|
|
{
|
2019-06-17 18:33:38 +00:00
|
|
|
(var componentID, var component) = this.ReadComponent<MockComponent>();
|
|
|
|
|
|
|
|
component.myInt = 420;
|
|
|
|
component.myString = "blaze it";
|
|
|
|
this.UpdateComponent(componentID, component);
|
|
|
|
|
|
|
|
resultComponent = this.ReadComponent<MockComponent>().Value;
|
2019-06-15 07:39:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void UpdateComponent()
|
|
|
|
{
|
|
|
|
var worldBuilder = new WorldBuilder();
|
|
|
|
worldBuilder.AddEngine<UpdateComponentTestEngine>();
|
|
|
|
|
|
|
|
var entity = worldBuilder.CreateEntity();
|
|
|
|
|
|
|
|
MockComponent mockComponent;
|
|
|
|
mockComponent.myInt = 0;
|
|
|
|
mockComponent.myString = "hello";
|
|
|
|
|
|
|
|
entity.AddComponent(mockComponent);
|
|
|
|
|
|
|
|
var world = worldBuilder.Build();
|
|
|
|
|
|
|
|
world.Update(0.01f);
|
|
|
|
|
2019-06-15 18:40:42 +00:00
|
|
|
Assert.AreEqual(420, resultComponent.myInt);
|
|
|
|
Assert.AreEqual("blaze it", resultComponent.myString);
|
2019-06-15 07:39:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public class UndeclaredUpdateComponentTestEngine : Engine
|
|
|
|
{
|
|
|
|
public override void Update(float dt)
|
|
|
|
{
|
2019-06-17 18:33:38 +00:00
|
|
|
(var componentID, var component) = this.ReadComponent<MockComponent>();
|
|
|
|
|
|
|
|
component.myInt = 420;
|
|
|
|
component.myString = "blaze it";
|
|
|
|
this.UpdateComponent(componentID, component);
|
|
|
|
|
|
|
|
component = this.ReadComponent<MockComponent>().Value;
|
2019-06-15 07:39:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void UpdateUndeclaredComponent()
|
|
|
|
{
|
|
|
|
var worldBuilder = new WorldBuilder();
|
|
|
|
worldBuilder.AddEngine<UndeclaredUpdateComponentTestEngine>();
|
|
|
|
|
|
|
|
var entity = worldBuilder.CreateEntity();
|
|
|
|
|
|
|
|
MockComponent mockComponent;
|
|
|
|
mockComponent.myInt = 0;
|
|
|
|
mockComponent.myString = "hello";
|
|
|
|
|
|
|
|
entity.AddComponent(mockComponent);
|
|
|
|
|
|
|
|
var world = worldBuilder.Build();
|
|
|
|
|
2019-06-15 19:32:56 +00:00
|
|
|
var ex = Assert.Throws<IllegalComponentMutationException>(() => world.Update(0.01f));
|
2019-06-15 18:40:42 +00:00
|
|
|
Assert.That(ex.Message, Is.EqualTo("Engine UndeclaredUpdateComponentTestEngine tried to mutate undeclared Component MockComponent"));
|
2019-06-15 07:39:08 +00:00
|
|
|
}
|
2019-06-16 01:55:35 +00:00
|
|
|
|
|
|
|
struct MockMessage : IMessage
|
|
|
|
{
|
|
|
|
public string myString;
|
|
|
|
}
|
|
|
|
|
|
|
|
[Emits(typeof(MockMessage))]
|
|
|
|
public class MessageEmitEngine : Engine
|
|
|
|
{
|
|
|
|
public override void Update(float dt)
|
|
|
|
{
|
|
|
|
MockMessage message;
|
|
|
|
message.myString = "howdy";
|
|
|
|
|
|
|
|
this.EmitMessage(message);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
[Reads(typeof(MockMessage))]
|
|
|
|
public class MessageReadEngine : Engine
|
|
|
|
{
|
|
|
|
public override void Update(float dt)
|
|
|
|
{
|
2019-06-17 01:03:57 +00:00
|
|
|
resultMessages = this.ReadMessages<MockMessage>().ToList();
|
2019-06-16 01:55:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void EmitAndReadMessage()
|
|
|
|
{
|
|
|
|
var worldBuilder = new WorldBuilder();
|
|
|
|
worldBuilder.AddEngine<MessageEmitEngine>();
|
|
|
|
worldBuilder.AddEngine<MessageReadEngine>();
|
|
|
|
|
|
|
|
var world = worldBuilder.Build();
|
|
|
|
|
|
|
|
world.Update(0.01f);
|
|
|
|
|
|
|
|
Assert.AreEqual(resultMessages.First().myString, "howdy");
|
|
|
|
}
|
|
|
|
|
|
|
|
public class UndeclaredMessageEmitEngine : Engine
|
|
|
|
{
|
|
|
|
public override void Update(float dt)
|
|
|
|
{
|
|
|
|
MockMessage message;
|
|
|
|
message.myString = "howdy";
|
|
|
|
|
|
|
|
this.EmitMessage(message);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-22 00:23:52 +00:00
|
|
|
static IEnumerable<MockMessage> emptyReadMessagesResult;
|
|
|
|
[Reads(typeof(MockMessage))]
|
|
|
|
class ReadMessagesWhenNoneExistEngine : Engine
|
|
|
|
{
|
|
|
|
public override void Update(float dt)
|
|
|
|
{
|
|
|
|
emptyReadMessagesResult = ReadMessages<MockMessage>();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void ReadMessagesWhenNoneHaveBeenEmitted()
|
|
|
|
{
|
|
|
|
var worldBuilder = new WorldBuilder();
|
|
|
|
worldBuilder.AddEngine<ReadMessagesWhenNoneExistEngine>();
|
|
|
|
|
|
|
|
var world = worldBuilder.Build();
|
|
|
|
|
|
|
|
world.Update(0.01f);
|
|
|
|
|
|
|
|
emptyReadMessagesResult.Should().BeEmpty();
|
|
|
|
}
|
|
|
|
|
2019-06-16 01:55:35 +00:00
|
|
|
[Test]
|
|
|
|
public void EmitUndeclaredMessage()
|
|
|
|
{
|
|
|
|
var worldBuilder = new WorldBuilder();
|
|
|
|
worldBuilder.AddEngine<UndeclaredMessageEmitEngine>();
|
|
|
|
|
|
|
|
var world = worldBuilder.Build();
|
|
|
|
|
|
|
|
var ex = Assert.Throws<IllegalMessageEmitException>(() => world.Update(0.01f));
|
|
|
|
Assert.That(ex.Message, Is.EqualTo("Engine UndeclaredMessageEmitEngine tried to emit undeclared Message MockMessage"));
|
|
|
|
}
|
2019-06-17 01:11:35 +00:00
|
|
|
|
|
|
|
static bool someTest;
|
|
|
|
|
|
|
|
[Emits(typeof(MockMessage))]
|
|
|
|
class EmitMockMessageEngine : Engine
|
|
|
|
{
|
|
|
|
public override void Update(float dt)
|
|
|
|
{
|
|
|
|
MockMessage message;
|
|
|
|
message.myString = "howdy";
|
|
|
|
|
|
|
|
this.EmitMessage(message);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
[Reads(typeof(MockMessage))]
|
|
|
|
class SomeTestEngine : Engine
|
|
|
|
{
|
|
|
|
public override void Update(float dt)
|
|
|
|
{
|
|
|
|
someTest = this.Some<MockMessage>();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void Some()
|
|
|
|
{
|
|
|
|
var worldBuilder = new WorldBuilder();
|
|
|
|
worldBuilder.AddEngine<EmitMockMessageEngine>();
|
|
|
|
worldBuilder.AddEngine<SomeTestEngine>();
|
|
|
|
|
|
|
|
var world = worldBuilder.Build();
|
|
|
|
|
|
|
|
world.Update(0.01f);
|
|
|
|
|
|
|
|
Assert.That(someTest, Is.True);
|
|
|
|
}
|
2019-06-17 01:16:45 +00:00
|
|
|
|
|
|
|
class UndeclaredSomeEngine : Engine
|
|
|
|
{
|
|
|
|
public override void Update(float dt)
|
|
|
|
{
|
|
|
|
someTest = this.Some<MockMessage>();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void IllegalSome()
|
|
|
|
{
|
|
|
|
var worldBuilder = new WorldBuilder();
|
|
|
|
worldBuilder.AddEngine<EmitMockMessageEngine>();
|
|
|
|
worldBuilder.AddEngine<UndeclaredSomeEngine>();
|
|
|
|
|
|
|
|
var world = worldBuilder.Build();
|
|
|
|
|
|
|
|
Assert.Throws<IllegalMessageReadException>(() => world.Update(0.01f));
|
|
|
|
}
|
2019-06-17 19:12:07 +00:00
|
|
|
|
|
|
|
static KeyValuePair<Guid, MockComponent> pairA;
|
|
|
|
static KeyValuePair<Guid, MockComponent> pairB;
|
|
|
|
|
|
|
|
class SameValueComponentReadEngine : Engine
|
|
|
|
{
|
|
|
|
public override void Update(float dt)
|
|
|
|
{
|
|
|
|
var components = this.ReadComponents<MockComponent>();
|
|
|
|
|
|
|
|
pairA = components.First();
|
|
|
|
pairB = components.Last();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Tests that components with identical values should be distinguishable by ID
|
|
|
|
[Test]
|
|
|
|
public void SameValueComponents()
|
|
|
|
{
|
|
|
|
var worldBuilder = new WorldBuilder();
|
|
|
|
worldBuilder.AddEngine<SameValueComponentReadEngine>();
|
|
|
|
|
|
|
|
MockComponent componentA;
|
|
|
|
componentA.myInt = 20;
|
|
|
|
componentA.myString = "hello";
|
|
|
|
|
|
|
|
MockComponent componentB;
|
|
|
|
componentB.myInt = 20;
|
|
|
|
componentB.myString = "hello";
|
|
|
|
|
|
|
|
var entity = worldBuilder.CreateEntity();
|
|
|
|
entity.AddComponent(componentA);
|
|
|
|
entity.AddComponent(componentB);
|
|
|
|
|
|
|
|
var world = worldBuilder.Build();
|
|
|
|
world.Update(0.01f);
|
|
|
|
|
|
|
|
Assert.That(pairA, Is.Not.EqualTo(pairB));
|
|
|
|
Assert.That(pairA.Value, Is.EqualTo(pairB.Value));
|
|
|
|
}
|
|
|
|
|
|
|
|
static IEnumerable<KeyValuePair<Guid, MockComponent>> emptyComponentReadResult;
|
|
|
|
|
|
|
|
class ReadEmptyMockComponentsEngine : Engine
|
|
|
|
{
|
|
|
|
public override void Update(float dt)
|
|
|
|
{
|
|
|
|
emptyComponentReadResult = this.ReadComponents<MockComponent>();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void ReadComponentsOfTypeWhereNoneExist()
|
|
|
|
{
|
|
|
|
var worldBuilder = new WorldBuilder();
|
|
|
|
worldBuilder.AddEngine<ReadEmptyMockComponentsEngine>();
|
|
|
|
|
|
|
|
var world = worldBuilder.Build();
|
|
|
|
world.Update(0.01f);
|
|
|
|
|
|
|
|
Assert.That(emptyComponentReadResult, Is.Empty);
|
|
|
|
}
|
2019-06-20 03:37:46 +00:00
|
|
|
|
|
|
|
struct DestroyerComponent : IComponent { }
|
|
|
|
|
|
|
|
class DestroyerEngine : Engine
|
|
|
|
{
|
|
|
|
public override void Update(float dt)
|
|
|
|
{
|
|
|
|
var componentPairs = ReadComponents<DestroyerComponent>();
|
|
|
|
|
|
|
|
foreach (var componentPair in componentPairs)
|
|
|
|
{
|
|
|
|
var componentID = componentPair.Key;
|
2019-06-22 00:50:01 +00:00
|
|
|
var entityID = GetEntityIDByComponentID(componentID);
|
2019-06-20 03:37:46 +00:00
|
|
|
Destroy(entityID);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static IEnumerable<KeyValuePair<Guid, MockComponent>> results;
|
|
|
|
class ReaderEngine : Engine
|
|
|
|
{
|
|
|
|
public override void Update(float dt)
|
|
|
|
{
|
|
|
|
results = ReadComponents<MockComponent>();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void DestroyEntity()
|
|
|
|
{
|
|
|
|
var worldBuilder = new WorldBuilder();
|
|
|
|
worldBuilder.AddEngine<DestroyerEngine>();
|
|
|
|
worldBuilder.AddEngine<ReaderEngine>();
|
|
|
|
|
|
|
|
var entity = worldBuilder.CreateEntity();
|
|
|
|
var entityB = worldBuilder.CreateEntity();
|
|
|
|
|
|
|
|
DestroyerComponent destroyerComponent;
|
|
|
|
MockComponent mockComponent;
|
|
|
|
mockComponent.myInt = 2;
|
|
|
|
mockComponent.myString = "blah";
|
|
|
|
|
|
|
|
entity.AddComponent(destroyerComponent);
|
|
|
|
var componentID = entity.AddComponent(mockComponent);
|
|
|
|
|
|
|
|
entityB.AddComponent(destroyerComponent);
|
|
|
|
var componentBID = entityB.AddComponent(mockComponent);
|
|
|
|
|
|
|
|
var world = worldBuilder.Build();
|
|
|
|
|
|
|
|
world.Update(0.01f);
|
|
|
|
|
|
|
|
Assert.That(results, Does.Not.Contain(new KeyValuePair<Guid, MockComponent>(componentID, mockComponent)));
|
|
|
|
Assert.That(results, Does.Not.Contain(new KeyValuePair<Guid, MockComponent>(componentBID, mockComponent)));
|
|
|
|
}
|
2019-06-22 00:44:07 +00:00
|
|
|
|
|
|
|
static Entity entityFromComponentIDResult;
|
|
|
|
class GetEntityFromComponentIDEngine : Engine
|
|
|
|
{
|
|
|
|
public override void Update(float dt)
|
|
|
|
{
|
|
|
|
var componentID = ReadComponent<MockComponent>().Key;
|
2019-06-22 00:50:01 +00:00
|
|
|
entityFromComponentIDResult = GetEntityByComponentID(componentID);
|
2019-06-22 00:44:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void GetEntityFromComponentID()
|
|
|
|
{
|
|
|
|
var worldBuilder = new WorldBuilder();
|
|
|
|
worldBuilder.AddEngine<GetEntityFromComponentIDEngine>();
|
|
|
|
|
|
|
|
MockComponent component;
|
|
|
|
component.myInt = 2;
|
|
|
|
component.myString = "howdy";
|
|
|
|
|
|
|
|
var entity = worldBuilder.CreateEntity();
|
|
|
|
entity.AddComponent(component);
|
|
|
|
|
|
|
|
var world = worldBuilder.Build();
|
|
|
|
world.Update(0.01f);
|
|
|
|
|
|
|
|
Assert.That(entity, Is.EqualTo(entityFromComponentIDResult));
|
|
|
|
}
|
|
|
|
|
|
|
|
static MockComponent mockComponentByIDResult;
|
|
|
|
class GetComponentByIDEngine : Engine
|
|
|
|
{
|
|
|
|
public override void Update(float dt)
|
|
|
|
{
|
|
|
|
var componentID = ReadComponent<MockComponent>().Key;
|
|
|
|
mockComponentByIDResult = GetComponentByID<MockComponent>(componentID);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
[Test]
|
|
|
|
public void GetComponentByID()
|
|
|
|
{
|
|
|
|
var worldBuilder = new WorldBuilder();
|
|
|
|
worldBuilder.AddEngine<GetComponentByIDEngine>();
|
|
|
|
|
|
|
|
MockComponent component;
|
|
|
|
component.myInt = 2;
|
|
|
|
component.myString = "howdy";
|
|
|
|
|
|
|
|
var entity = worldBuilder.CreateEntity();
|
|
|
|
entity.AddComponent(component);
|
|
|
|
|
|
|
|
var world = worldBuilder.Build();
|
|
|
|
world.Update(0.01f);
|
|
|
|
|
|
|
|
Assert.That(component, Is.EqualTo(mockComponentByIDResult));
|
|
|
|
}
|
|
|
|
|
|
|
|
struct OtherComponent : IComponent { }
|
|
|
|
|
|
|
|
class GetComponentByIDWithTypeMismatchEngine : Engine
|
|
|
|
{
|
|
|
|
public override void Update(float dt)
|
|
|
|
{
|
|
|
|
var componentID = ReadComponent<MockComponent>().Key;
|
|
|
|
GetComponentByID<OtherComponent>(componentID);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void GetComponentByIDWithTypeMismatch()
|
|
|
|
{
|
|
|
|
var worldBuilder = new WorldBuilder();
|
|
|
|
worldBuilder.AddEngine<GetComponentByIDWithTypeMismatchEngine>();
|
|
|
|
|
|
|
|
MockComponent component;
|
|
|
|
component.myInt = 2;
|
|
|
|
component.myString = "howdy";
|
|
|
|
|
|
|
|
var entity = worldBuilder.CreateEntity();
|
|
|
|
entity.AddComponent(component);
|
|
|
|
|
|
|
|
var world = worldBuilder.Build();
|
|
|
|
|
|
|
|
Assert.Throws<ComponentTypeMismatchException>(() => world.Update(0.01f));
|
|
|
|
}
|
2019-06-15 00:51:06 +00:00
|
|
|
}
|
|
|
|
}
|