コード例 #1
0
        /// <summary>
        /// Removes the Pokemon from the list of roaming Pokemon. The Pokemon has to hold the data as Tag.
        /// </summary>
        /// <param name="p">The Pokemon containing the Tag.</param>
        public static string RemoveRoamingPokemon(RoamingPokemon p)
        {
            string compareData = p.CompareData();

            string newData = "";

            foreach (string line in Core.Player.RoamingPokemonData.SplitAtNewline())
            {
                if (line.StartsWith(compareData) == false)
                {
                    if (!string.IsNullOrEmpty(newData))
                    {
                        newData += Environment.NewLine;
                    }
                    newData += line;
                }
            }

            return(newData);
        }
コード例 #2
0
        public static string ReplaceRoamingPokemon(RoamingPokemon p)
        {
            string compareData = p.CompareData();

            string newData = "";

            foreach (string line in Core.Player.RoamingPokemonData.SplitAtNewline())
            {
                if (!string.IsNullOrEmpty(newData))
                {
                    newData += Environment.NewLine;
                }
                if (line.StartsWith(compareData) == false)
                {
                    newData += line;
                }
                else
                {
                    newData += p.PokemonReference.Number + "|" + p.PokemonReference.Level + "|" + p.WorldID + "|" + p.LevelFile + "|" + p.MusicLoop + "|" + p.PokemonReference.GetSaveData();
                }
            }

            return(newData);
        }