/// <summary> /// Add new System to World. /// </summary> /// <param name="system">New system.</param> /// <param name="created">Created flag.</param> public void AddSystem(BaseSystem system, out bool created) { #if DEBUG if (HasSystem(system.GetType())) { created = false; throw new SystemAlreadyExistsException(); } #endif system.Init(WorldRef); m_SystemsList.Add(system.GetType(), system); created = true; }
/// <summary> /// Removes a system from World. /// </summary> /// <param name="system">System instance to remove.</param> public void RemoveSystem(BaseSystem system) { Type systemType = system.GetType(); #if DEBUG if (!HasSystem(systemType) || GetSystem(systemType) != system) { throw new SystemNotFoundException(); } #endif m_SystemsList.Remove(systemType); }
/// <summary> /// Remove given System from World. /// </summary> /// <param name="system">Given System.</param> internal void RemoveSystem(BaseSystem system) { SystemsStorage.RemoveSystem(system.GetType()); }