public async Task <GameModeDefinition> GetGamemodeDefinition(ModObjectReference gamemode)
        {
            if (!mods.ContainsKey(gamemode.modIdentifier))
            {
                return(null);
            }

            GameModeDefinition g = await mods[gamemode.modIdentifier].GetGamemodeDefinition(gamemode.objectName);

            if (g == null)
            {
                return(null);
            }

            return(g);
        }
        public async Task <EntityDefinition> GetEntity(ModObjectReference entity)
        {
            entity.modIdentifier = entity.modIdentifier.ToLower();
            if (!mods.ContainsKey(entity.modIdentifier))
            {
                return(null);
            }

            EntityDefinition e = await mods[entity.modIdentifier].GetEntityDefinition(entity.objectName);

            if (e == null)
            {
                return(null);
            }

            return(e);
        }
        public async Task <StageCollection> GetStageCollection(ModObjectReference stageCollection)
        {
            stageCollection.modIdentifier = stageCollection.modIdentifier.ToLower();
            if (!mods.ContainsKey(stageCollection.modIdentifier))
            {
                return(null);
            }

            StageCollection c = await mods[stageCollection.modIdentifier].GetStageCollection(stageCollection.objectName);

            if (c == null)
            {
                return(null);
            }

            return(c);
        }
        public async Task <StageDefinition> GetStageDefinition(ModObjectReference stage)
        {
            stage.modIdentifier = stage.modIdentifier.ToLower();
            if (!mods.ContainsKey(stage.modIdentifier))
            {
                return(null);
            }

            StageDefinition s = await mods[stage.modIdentifier].GetStageDefinition(stage.objectName);

            if (s == null)
            {
                return(null);
            }

            return(s);
        }
        public SoundDefinition GetSoundDefinition(ModObjectReference sound)
        {
            if (sound == null)
            {
                return(null);
            }

            if (!mods.ContainsKey(sound.modIdentifier))
            {
                return(null);
            }

            SoundDefinition g = mods[sound.modIdentifier].GetSoundDefinition(sound.objectName);

            if (g == null)
            {
                return(null);
            }

            return(g);
        }
        public async Task <List <string> > LoadStage(ModObjectReference stage)
        {
            List <string> result = new List <string>(1);

            if (mods.TryGetValue(stage.modIdentifier, out IModDefinition mod))
            {
                StageDefinition sd = await mod.GetStageDefinition(stage.objectName);

                if (sd)
                {
                    if (mod.LocalMod)
                    {
                        result = await mod.LoadStageAsync(sd.stageIdentifier, LoadSceneMode.Additive);

                        return(result);
                    }
                    else
                    {
                        if (modLoader.loadedMods.TryGetValue(stage.modIdentifier, out ModHost modHost))
                        {
                            for (int i = 0; i < sd.sceneNames.Length; i++)
                            {
                                if (!modHost.Scenes.Exists(sd.sceneNames[i]))
                                {
                                    result.Add(null);
                                    break;
                                }
                                await modHost.Scenes.LoadAsync(sd.sceneNames[i], true);

                                result.Add(sd.sceneNames[i]);
                            }
                        }
                    }
                }
            }
            return(result);
        }