From bdd9f595493609444d8ebb31b9d07b7ef320eafb Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Thu, 6 Aug 2020 14:11:28 -0700 Subject: [PATCH] fix worldBuilder being able to set a non-component --- encompass-cs/WorldBuilder.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/encompass-cs/WorldBuilder.cs b/encompass-cs/WorldBuilder.cs index 7da9ced..2fe307e 100644 --- a/encompass-cs/WorldBuilder.cs +++ b/encompass-cs/WorldBuilder.cs @@ -82,7 +82,7 @@ namespace Encompass /// /// Sets Component data for the specified Component Type on the specified Entity. /// - public void SetComponent(Entity entity, in TComponent component) where TComponent : struct + public void SetComponent(Entity entity, in TComponent component) where TComponent : struct, IComponent { RegisterComponentType(); _startingExistingComponentStore.Set(entity.ID, component); @@ -95,7 +95,7 @@ namespace Encompass } } - internal void RegisterComponentType() where TComponent : struct + internal void RegisterComponentType() where TComponent : struct, IComponent { if (!_typeToIndex.ContainsKey(typeof(TComponent))) {