Beispiel #1
0
        private void InitialiseEachWorld(List <Type> systems)
        {
            foreach (var data in WorldData.Values)
            {
                /*
                 * Create the world
                 */
                if (data.Options.Name == "Default World")
                {
                    data.World = World.Active;
                    CustomWorlds.Add(data.Options.Name, data.World);
                    continue;
                }
                else
                {
                    data.World = new World(data.Options.Name);
                    CustomWorlds.Add(data.Options.Name, data.World);

                    if (m_CreateDefaultWorld && m_DefaultWorldName != "Default World" && data.Options.Name == m_DefaultWorldName)
                    {
                        ScriptBehaviourUpdateOrder.UpdatePlayerLoop(data.World);
                    }
                }

                /*
                 * Create systems in the world
                 */
                data.WorldSystems = GetSystemTypesIncludingUpdateInGroupAncestors(data.Options.Name, systems).ToList();
                if (data.Options.CustomIncludeQuery != null)
                {
                    data.WorldSystems.AddRange(data.Options.CustomIncludeQuery(systems));
                    data.WorldSystems = data.WorldSystems.Distinct().ToList();
                }
                foreach (var worldSystemType in data.WorldSystems)
                {
                    data.World.CreateSystem(worldSystemType);
                }

                /*
                 * Build the UpdateInGroup Hierarchy
                 */
                BuildHierarchy(data);
            }
        }
        private void InitialiseEachWorld(List <Type> systems)
        {
            var defaultSystemTypes = GetDefaultSystemTypes(systems);

            foreach (var data in WorldData.Values)
            {
                /*
                 * Create the world
                 */
                if (data.Options.Name == DEFAULTWORLDNAME)
                {
                    data.World = World.Active;
                    CustomWorlds.Add(data.Options.Name, data.World);
                    continue;
                }
                else
                {
                    data.World = new World(data.Options.Name);
                    CustomWorlds.Add(data.Options.Name, data.World);
                }

                /*
                 * Create systems in the world
                 */
                data.WorldSystems = GetSystemTypesIncludingUpdateInGroupAncestors(data.Options.Name, systems).ToList();
                foreach (var worldSystemType in data.WorldSystems)
                {
                    data.World.CreateSystem(worldSystemType);
                }

                /*
                 * Build the UpdateInGroup Hierarchy
                 */
                BuildHierarchy(data);
            }
        }