public void QueueAddComponent(EntityComponentBase component) { using (WriteLock.CreateLock(m_componentsAddQueueLock)) { m_componentsAddQueue.Add(component); } }
public EntityComponentBase GetBaseComponent(Type type) { EntityComponentBase componentOut = null; foreach (var comp in m_componentsSorted) { if (comp.Value.GetType().IsSubclassOf(type)) { componentOut = comp.Value; } } return(componentOut); }
public void AddComponentAsType(EntityComponentBase component, Type type) { using (UpgradeableReadLock.CreateLock(m_componentsSortedLock)) { if (m_componentsSorted.ContainsKey(type.FullName.GetHashCode())) { return; } using (WriteLock.CreateLock(m_componentsSortedLock)) { m_componentsSorted[type.FullName.GetHashCode()] = component; } } }