Example #1
0
        private void GetOnlineTeam(string result)
        {
            List <API.JoltValue> list = API.HandleData(result);

            if (Convert.ToBoolean(list[0].Value) == true)
            {
                this.OnlineTeam = new List <BasePokemon>();
                string data = result.Remove(0, 22);
                data = data.Remove(data.LastIndexOf("\""));
                string[] dataArray = data.SplitAtNewline();

                foreach (string line in dataArray)
                {
                    if (line.StartsWith("{") == true && line.EndsWith("}") == true)
                    {
                        string pokemonData = line.Replace("\\\"", "\"");

                        this.OnlineTeam.Add(BasePokemon.GetPokemonByData(pokemonData));
                    }
                }
            }
            else
            {
                this.OnlineTeam = null;
            }
        }
        public RoamingPokemon(string DataLine)
        {
            string[] data = DataLine.Split(Convert.ToChar("|"));

            PokemonReference = BasePokemon.GetPokemonByData(data[5]);

            WorldID   = Convert.ToInt32(data[2]);
            LevelFile = data[3];
            MusicLoop = data[4];
        }