Beispiel #1
0
 public EncounterData(LocationData location, ulong encounterId, PokemonData pokemonData, float?probability, string spawnPointId, EncounterSourceTypes source)
 {
     Location     = location;
     EncounterId  = encounterId;
     PokemonData  = pokemonData;
     Probability  = probability;
     SpawnPointId = spawnPointId;
     Source       = source;
 }
Beispiel #2
0
 public void Save(PokeRoadieInventory inventory, PokemonData pokemon, GeoCoordinate geo, string playerName, int playerLevel, string playerTeam, ulong encounterId, EncounterSourceTypes encounterType, string filePath)
 {
     try
     {
         var data = new Xml.PokemonEncounter()
         {
             EncounterId      = encounterId,
             EncounterType    = Convert.ToInt32(encounterType),
             Latitude         = geo.Latitude,
             Longitude        = geo.Longitude,
             Altitude         = geo.Altitude,
             Player           = playerName,
             PlayerLevel      = playerLevel,
             PlayerTeam       = playerTeam,
             Cp               = pokemon.Cp,
             IV               = pokemon.GetPerfection(),
             V                = CalculatePokemonValue(pokemon),
             NumberOfUpgrades = System.Convert.ToInt32(pokemon.GetLevel()),
             Type             = pokemon.PokemonId.ToString()
         };
         Xml.Serializer.SerializeToFile(data, filePath);
     }
     catch// (Exception e)
     {
         //Logger.Write($"Could not save the encounter information file for {encounterId} - {e.ToString()}", LogLevel.Error);
     }
 }