/// <summary>
        /// Create a new GameMode.
        /// </summary>
        /// <param name="name">The name of the new GameMode.</param>
        /// <param name="description">The description of the new GameMode.</param>
        /// <param name="version">The version of the new GameMode. Warning: This doesn't have to be a number!</param>
        /// <param name="author">The author of the new GameMode.</param>
        /// <param name="mapPath">The MapPath used from the new GameMode to load maps from.</param>
        /// <param name="scriptPath">The ScriptPath used from the new GameMode to load scripts from.</param>
        /// <param name="pokeFilePath"></param>
        /// <param name="pokemonDataPath">The Pokemon-Datapath to load Pokemon data from.</param>
        /// <param name="contentPath">The path to load images, sound and music from.</param>
        /// <param name="localizationsPath"></param>
        /// <param name="gameRules">The GameRules that apply to the new GameMode.</param>
        /// <param name="startMap">The start map for the new GameMode.</param>
        /// <param name="startPosition">The start position for the new GameMode.</param>
        /// <param name="startRotation">The start rotation for the new GameMode.</param>
        /// <param name="startLocationName">The start location name for the new GameMode.</param>
        /// <param name="startDialogue"></param>
        /// <param name="startColor"></param>
        /// <param name="pokemonRange">The Pokémon that appear on the new game screen for the new GameMode.</param>
        /// <param name="introMusic">The intro music that plays on the new game screen for the new GameMode.</param>
        /// <param name="skinColors">The skin colors for the new GameMode. Must be the same amount as SkinFiles and SkinNames.</param>
        /// <param name="skinFiles">The skin files for the new GameMode. Must be the same amount as SkinColors and SkinNames.</param>
        /// <param name="skinNames">The skin names for the new GameMode. Must be the same amount as SkinFiles and SkinColors.</param>
        private GameMode(string name, string description, string version, string author, MapsFolder mapFolder, ScriptsFolder scriptFolder, PokeFolder pokeFolder, PokemonDataFolder pokemonDataFolder, ContentFolder contentFolder, LocalizationsFolder localizationsFolder, GameRuleList gameRules,
                         string startMap, Vector3 startPosition, float startRotation, string startLocationName, string startDialogue, Color startColor, int[] pokemonRange, string introMusic, List <Color> skinColors, List <string> skinFiles, List <string> skinNames)
        {
            Name               = name;
            Description        = description;
            Version            = version;
            Author             = author;
            MapFolder          = mapFolder;
            ScriptFolder       = scriptFolder;
            PokeFolder         = pokeFolder;
            PokemonDataFolder  = pokemonDataFolder;
            ContentFolder      = contentFolder;
            LocalizationFolder = localizationsFolder;
            GameRules          = gameRules;

            StartMap          = startMap;
            StartPosition     = startPosition;
            StartRotation     = startRotation;
            StartLocationName = startLocationName;
            StartDialogue     = startDialogue;
            StartColor        = startColor;
            PokemonRange      = pokemonRange;
            IntroMusic        = introMusic;
            SkinColors        = skinColors;
            SkinFiles         = skinFiles;
            SkinNames         = skinNames;
        }
Beispiel #2
0
        private static void LoadTokenFile(LocalizationsFolder localizationsFolder, bool isGameModeFile)
        {
            var defaultLanguage  = new CultureInfo("en");
            var localizationInfo = new LocalizationInfo(Language);

            if (!localizationsFolder.CheckTranslationExists(localizationInfo))
            {
                Language = defaultLanguage;
            }

            LocalizationFiles.AddRange(localizationsFolder.GetTranslationFolder(localizationInfo).GetTranslationFiles().ToList());
            if (!Equals(Language, defaultLanguage))
            {
                LocalizationFiles.AddRange(localizationsFolder.GetTranslationFolder(new LocalizationInfo(defaultLanguage)).GetTranslationFiles().ToList());
            }


            /*
             * {
             *  foreach (var tokenLine in localizationsFolder.GetTranslationFolder(localizationInfo).GetTranslationFile(Language).ReadAllLines())
             *  {
             *      if (tokenLine.Contains(","))
             *      {
             *          var splitIdx = tokenLine.IndexOf(",", StringComparison.Ordinal);
             *
             *          var tokenName = tokenLine.Substring(0, splitIdx);
             *          var tokenContent = "";
             *          if (tokenLine.Length > tokenName.Length + 1)
             *              tokenContent = tokenLine.Substring(splitIdx + 1, tokenLine.Length - splitIdx - 1);
             *
             *          if (!LocalizationTokens.ContainsKey(tokenName))
             *              LocalizationTokens.Add(tokenName,
             *                  new Token(tokenName, tokenContent, Language, isGameModeFile));
             *      }
             *  }
             * }
             *
             *
             *
             * // -- Load default definitions, the current language may not have everything translated
             * if (!Equals(Language, defaultLanguage))
             * {
             *  if (localizationFolder.CheckTranslationExists(defaultLanguage))
             *  {
             *      foreach (var tokenLine in localizationFolder.GetTranslationFile(defaultLanguage).ReadAllLines())
             *      {
             *          if (tokenLine.Contains(","))
             *          {
             *              var splitIdx = tokenLine.IndexOf(",", StringComparison.Ordinal);
             *
             *              var tokenName = tokenLine.Substring(0, splitIdx);
             *              var tokenContent = "";
             *              if (tokenLine.Length > tokenName.Length + 1)
             *                  tokenContent = tokenLine.Substring(splitIdx + 1, tokenLine.Length - splitIdx - 1);
             *
             *              if (!LocalizationTokens.ContainsKey(tokenName))
             *                  LocalizationTokens.Add(tokenName, new Token(tokenName, tokenContent, defaultLanguage, isGameModeFile));
             *          }
             *      }
             *  }
             * }
             */
        }