public static ISystem CreateSystem(this Pools pools, IReactiveSystem system) { throw new EntitasException( "pools.CreateSystem(" + system + ") can not infer which pool to use to create a ReactiveSystem!", "pools.CreateSystem(system) only supports IInitializeSystem, IExecuteSystem, ICleanupSystem, ITearDownSystem and IEntityCollectorSystem." ); }
public virtual bool ShutDown() { m_IShutDownSystems.Exect_ReverseOrder((IShutDownSystem sys) => { sys.ShutDown(); }); //清理Sys m_IExecuteSystems.Exect_Order((IExecuteSystem sys) => { IReactiveSystem irs = sys as IReactiveSystem; if (irs != null) { irs.Deactivate(); irs.Clear(); } }); m_IInitializeSystems.Systems.Clear(); m_IExecuteSystems.Systems.Clear(); m_IShutDownSystems.Systems.Clear(); return(true); }
public ReactiveSystemDto(IReactiveSystem reactiveSystem) { if (reactiveSystem == null) { throw new Exception("System Is Null"); } _currentSystem = reactiveSystem; _entityHashSet = new HashSet <Entity>(); }
public static void Unsubscribe(IReactiveSystem system) { if (system == null) { throw new ArgumentNullException(); } if (reactiveSystems.Contains(system)) { reactiveSystems.Remove(system); } }
public void Init() { mWorldContext = new WorldContextFactory().CreateNewWorldInstance(); mSystemManager = new SystemManager(mWorldContext); mRegisterViewsSystem = new RegisterViewSystem(mWorldContext); mSystemManager.RegisterSystem(mRegisterViewsSystem); mSystemManager.Init(); }
public static void Subscribe(IReactiveSystem system) { if (system == null) { throw new ArgumentNullException(); } if (!reactiveSystems.Contains(system)) { reactiveSystems.Add(system); } else { Console.Write("System is already subscribed"); } }
public virtual bool Initialize() { //激活响应Sys m_IExecuteSystems.Exect_Order((IExecuteSystem sys) => { IReactiveSystem irs = sys as IReactiveSystem; if (irs != null) { irs.Activate(); } }); m_IInitializeSystems.Exect_ReverseOrder((IInitializeSystem sys) => { sys.Initialize(); }); return(true); }
/// Recommended way to create systems in general: pool.CreateSystem<RenderPositionSystem>(); public ReactiveSystem(Pool pool, IReactiveSystem subSystem) : this(pool, subSystem, new [] { subSystem.trigger }) { }
/// Recommended way to create systems in general: /// pool.CreateSystem(new MySystem()); public ReactiveSystem(Pool pool, IReactiveSystem subSystem) : this( subSystem, createEntityCollector(pool, new [] { subSystem.trigger }) ) { }
public ReactiveSystem(Pool pool, IReactiveSystem subSystem) : this(pool, subSystem, new [] { subSystem.trigger }, new [] { subSystem.eventType }) { }
public ReactiveSystem(Pool pool, IReactiveSystem subSystem) { _subsystem = subSystem; _observer = new GroupObserver(pool.GetGroup(subSystem.GetTriggeringMatcher()), subSystem.GetEventType()); }
/// <summary> /// The method registers a given reactive system within the manager. Please DON'T use this method use Register /// method instead. /// </summary> /// <param name="system">A reference to IReactiveSystem implementation</param> /// <returns>An identifier of a system within the manager</returns> public SystemId RegisterSystem(IReactiveSystem system) { return(_registerSystem(system, mActiveReactiveSystems, (byte)E_SYSTEM_TYPE.ST_REACTIVE)); }
/// Recommended way to create systems in general: pool.CreateSystem<RenderPositionSystem>(); public ReactiveSystem(Pool pool, IReactiveSystem subSystem) : this(subSystem, createGroupObserver(pool, new [] { subSystem.trigger })) { }
/// Recommended way to create systems in general: pool.CreateSystem(new MySystem()); public ReactiveSystem(Pool pool, IReactiveSystem subSystem) : this(subSystem, createGroupObserver(pool, new [] { subSystem.trigger })) { }
public ReactiveSystem(Pool pool, IReactiveSystem subSystem) { _subsystem = subSystem; _observer = new GroupObserver(pool.GetGroup(subSystem.trigger), subSystem.eventType); }
public ReactiveSystem(Pool pool, IReactiveSystem subSystem) { _subsystem = subSystem; _observer = new GroupObserver(pool.GetGroup(subSystem.trigger), subSystem.eventType); _buffer = new List <Entity>(); }
/// Recommended way to create systems in general: pool.CreateSystem(new MySystem()); public ReactiveSystem(Pool <T> pool, IReactiveSystem <T> subSystem) : this(subSystem, CreateGroupObserver(pool, new[] { subSystem.Trigger })) { }