コード例 #1
0
        /// <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);
        }
コード例 #2
0
        /// <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;
        }
コード例 #3
0
 /// <summary>
 /// Add new System to World.
 /// </summary>
 /// <param name="system">New system.</param>
 public void AddSystem(BaseSystem system)
 {
     AddSystem(system, out bool created);
 }
コード例 #4
0
 /// <summary>
 /// Remove given System from World.
 /// </summary>
 /// <param name="system">Given System.</param>
 internal void RemoveSystem(BaseSystem system)
 {
     SystemsStorage.RemoveSystem(system.GetType());
 }
コード例 #5
0
 /// <summary>
 /// Add given System to World.
 /// </summary>
 /// <param name="system">Given System</param>
 public void AddSystem(BaseSystem system)
 {
     SystemsStorage.AddSystem(system);
 }