From d5a196b298a806efc076ad8a5519e9983ac8b4fa Mon Sep 17 00:00:00 2001 From: Evan Hemsley Date: Wed, 17 Jul 2019 11:31:18 -0700 Subject: [PATCH] read write lookups use hashset --- encompass-cs/Engine.cs | 10 +++++----- encompass-cs/attributes/Reads.cs | 4 ++-- encompass-cs/attributes/Writes.cs | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/encompass-cs/Engine.cs b/encompass-cs/Engine.cs index d51c8ca..5090cde 100644 --- a/encompass-cs/Engine.cs +++ b/encompass-cs/Engine.cs @@ -8,8 +8,8 @@ namespace Encompass { public abstract class Engine { - internal readonly List writeTypes = new List(); - internal readonly List readTypes = new List(); + internal readonly HashSet writeTypes = new HashSet(); + internal readonly HashSet readTypes = new HashSet(); private EntityManager entityManager; private ComponentManager componentManager; @@ -17,10 +17,10 @@ namespace Encompass protected Engine() { - var emitsAttribute = GetType().GetCustomAttribute(false); - if (emitsAttribute != null) + var writesAttribute = GetType().GetCustomAttribute(false); + if (writesAttribute != null) { - writeTypes = emitsAttribute.writeTypes; + writeTypes = writesAttribute.writeTypes; } var readsAttribute = GetType().GetCustomAttribute(false); diff --git a/encompass-cs/attributes/Reads.cs b/encompass-cs/attributes/Reads.cs index fbf6a0c..bd10431 100644 --- a/encompass-cs/attributes/Reads.cs +++ b/encompass-cs/attributes/Reads.cs @@ -8,7 +8,7 @@ namespace Encompass [System.AttributeUsage(System.AttributeTargets.Class)] public class Reads : System.Attribute { - public readonly List readTypes; + public readonly HashSet readTypes; public Reads(params Type[] readTypes) { @@ -20,7 +20,7 @@ namespace Encompass } } - this.readTypes = new List(readTypes); + this.readTypes = new HashSet(readTypes); } } } diff --git a/encompass-cs/attributes/Writes.cs b/encompass-cs/attributes/Writes.cs index 5af2c6c..67d03ae 100644 --- a/encompass-cs/attributes/Writes.cs +++ b/encompass-cs/attributes/Writes.cs @@ -8,7 +8,7 @@ namespace Encompass [AttributeUsage(AttributeTargets.Class)] public class Writes : Attribute { - public readonly List writeTypes; + public readonly HashSet writeTypes; public Writes(params Type[] writeTypes) { @@ -20,7 +20,7 @@ namespace Encompass } } - this.writeTypes = new List(writeTypes); + this.writeTypes = new HashSet(writeTypes); } } }