コード例 #1
0
 public ComponentsPool(ComponentType componentType, ConstructorInfo constructor, int capacity = 32)
 {
     _componentType = componentType;
     _constructor = constructor;
     _components = new Stack<Component>(capacity);
 }
コード例 #2
0
ファイル: EntityWorld.cs プロジェクト: remy22/BlueberryEngine
 internal Component GetComponent(Entity entity, ComponentType type)
 {
     Bag<Component> components;
     if (_globalStorage.TryGetValue(entity.Id, out components))
     {
         Component component;
         if (components.TryGetValue(type.Id, out component))
             return component;
     }
     return null;
 }