protected void Add([NotNull] IInitSystem system) { if (system == null) { throw new ArgumentNullException(nameof(system)); } GetOrCreateListAndAdd(ref _initSystems, system); }
/// <summary> /// 删除系统 /// </summary> /// <typeparam name="T"></typeparam> /// <returns></returns> public Observer RemoveSystem <T>() { IInitSystem initSystem = null; foreach (IInitSystem item in _systemInitList) { if (item.GetType() == typeof(T)) { initSystem = item; break; } } if (initSystem != null) { _systemInitList.Remove(initSystem); } //ISystem reactiveSystem = null; int index = -1; for (int i = 0; i < _systemReactiveDic.Count; i++) { if (_systemReactiveDic[i].CurrentSystem.GetType() == typeof(T)) { index = i; break; } } if (index > 0) { _systemReactiveDic.RemoveAt(index); } IExecuteSystem executeSystem = null; foreach (IExecuteSystem item in _systemExecuteList) { if (item.GetType() == typeof(T)) { executeSystem = item; break; } } if (executeSystem != null) { _systemExecuteList.Remove(executeSystem); } return(this); }
protected virtual void AddInitSystem(IInitSystem system) { _normalSystemMgr.AddInitSystem(system); }
/// <summary> /// The method register specialized system type which is IInitSystem. The systems of this type /// is executed only once at start of an application. Please DON'T use this method use Register /// method instead. /// </summary> /// <param name="system">A reference to ISystem implementation</param> /// <returns>An identifier of a system within the manager</returns> public SystemId RegisterSystem(IInitSystem system) { return(_registerSystem(system, mActiveInitSystems, (byte)E_SYSTEM_TYPE.ST_INIT)); }
public void AddInitSystem(IInitSystem system) { _initSystems.Add(system); }