14 void SetPool(
Pool pool);
26 void SetPools(
Pools pools);
42 return CreateSystem(pool, system,
Pools.sharedInstance);
51 SetPool(system, pool);
52 SetPools(system, pools);
63 return CreateSystem(pool, system,
Pools.sharedInstance);
74 SetPool(system, pool);
75 SetPools(system, pools);
78 if(reactiveSystem != null) {
82 if(multiReactiveSystem != null) {
86 if(entityCollectorSystem != null) {
91 "Could not create ReactiveSystem for " + system +
"!",
92 "The system has to implement IReactiveSystem, " +
93 "IMultiReactiveSystem or IEntityCollectorSystem." 100 SetPools(system, pools);
110 SetPools(system, pools);
113 if(entityCollectorSystem != null) {
118 "Could not create ReactiveSystem for " + system +
"!",
119 "Only IEntityCollectorSystem is supported for " +
120 "pools.CreateSystem(system)." 124 [Obsolete(
"pools.CreateSystem(system) can not infer which pool to set for ISetPool!",
true)]
127 "pools.CreateSystem(" + system +
") can not infer which pool " +
128 "to set for ISetPool!",
129 "pools.CreateSystem(system) only supports IInitializeSystem, " +
130 "IExecuteSystem, ICleanupSystem, ITearDownSystem and " +
131 "IEntityCollectorSystem." 135 [Obsolete(
"pools.CreateSystem(system) can not infer which pool to use to create a ReactiveSystem!",
true)]
138 "pools.CreateSystem(" + system +
") can not infer which pool " +
139 "to use to create a ReactiveSystem!",
140 "pools.CreateSystem(system) only supports IInitializeSystem, " +
141 "IExecuteSystem, ICleanupSystem, ITearDownSystem and " +
142 "IEntityCollectorSystem." 146 [Obsolete(
"pools.CreateSystem(system) can not infer which pool to use to create a ReactiveSystem!",
true)]
149 "pools.CreateSystem(" + system +
") can not infer which pool " +
150 "to use to create a ReactiveSystem!",
151 "pools.CreateSystem(system) only supports IInitializeSystem, " +
152 "IExecuteSystem, ICleanupSystem, ITearDownSystem and " +
153 "IEntityCollectorSystem." 159 var poolSystem = system as
ISetPool;
160 if(poolSystem != null) {
161 poolSystem.SetPool(pool);
168 if(poolsSystem != null) {
169 poolsSystem.SetPools(pools);
179 GroupEventType eventType = GroupEventType.OnEntityAdded) {
180 var groups =
new Group[pools.Length];
181 var eventTypes =
new GroupEventType[pools.Length];
183 for (
int i = 0; i < pools.Length; i++) {
184 groups[i] = pools[i].
GetGroup(matcher);
185 eventTypes[i] = eventType;
196 bool replaceExisting =
false,
197 params
int[] indices) {
199 entity.CopyTo(target, replaceExisting, indices);
static ISystem CreateSystem(this Pool pool, ISystem system)
static ISystem CreateSystem(this Pools pools, IReactiveExecuteSystem system)
static ISystem CreateSystem(this Pool pool, ISystem system, Pools pools)
virtual Group GetGroup(IMatcher matcher)
static ISystem CreateSystem(this Pools pools, ISystem system)
virtual Entity CreateEntity()
static void SetPool(ISystem system, Pool pool)
This will set the pool if ISetPool is implemented.
static Entity [] GetEntities(this Pool pool, IMatcher matcher)
Returns all entities matching the specified matcher.
static Entity CloneEntity(this Pool pool, Entity entity, bool replaceExisting=false, params int[] indices)
Entity [] GetEntities()
Returns all entities which are currently in this group.
static ISystem CreateSystem(this Pool pool, IReactiveExecuteSystem system)
static EntityCollector CreateEntityCollector(this Pool[] pools, IMatcher matcher, GroupEventType eventType=GroupEventType.OnEntityAdded)
Base exception used by Entitas.
static void SetPools(ISystem system, Pools pools)
This will set the pools if ISetPools is implemented.
static ISystem CreateSystem(this Pool pool, IReactiveExecuteSystem system, Pools pools)