Skip to content

Commit

Permalink
Merge pull request NecronomiconCoding#1639 from Dgc2002/master
Browse files Browse the repository at this point in the history
Change CSV dump to be comma seperated-values as well as output more data
  • Loading branch information
NecronomiconCoding authored Aug 1, 2016
2 parents f7151b4 + 9aa85a2 commit 612b2a8
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions PoGo.NecroBot.Logic/Tasks/DisplayPokemonStatsTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,24 +106,13 @@ public static async Task Execute(ISession session)
if (session.LogicSettings.DumpPokemonStats)
{
const string dumpFileName = "PokeBagStats";
Dumper.ClearDumpFile(session, dumpFileName, "csv");
Dumper.ClearDumpFile(session, dumpFileName);
Dumper.Dump(session, "pokemonid,pokemonlevel,cp,perfection,stamina,staminamax,move1,move2,candy,ownername,origin,heightm,weightkg,individualattack,individualdefense,individualstamina,cpmultiplier,battlesattacked,battlesdefended,creationtimems,numupgrades,additionalcpmultiplier,favorite,nickname", dumpFileName);
foreach (var pokemon in allPokemonInBag)
{
int candy = PokemonInfo.GetCandy(pokemon, myPokemonFamilies, myPokeSettings);
string pokeName = "";
if (pokemon.Favorite == 1)
{
pokeName += "*";
}
pokeName += pokemon.PokemonId.ToString();
if (!string.IsNullOrEmpty(pokemon.Nickname.ToString()))
{
pokeName += " (" + pokemon.Nickname.ToString() + ")";
}

Dumper.Dump(session,
string.Format($"NAME: {pokeName, -25} LVL: {PokemonInfo.GetLevel(pokemon).ToString("00"), -7} CP: {pokemon.Cp.ToString() + " / " + PokemonInfo.CalculateMaxCp(pokemon).ToString(), -15} IV: {PokemonInfo.CalculatePokemonPerfection(pokemon).ToString("0.00"), -10} MOVE1: {pokemon.Move1, -20} MOVE2: {pokemon.Move2, -20} Candies: {candy}"),
dumpFileName, "csv");
$"{pokemon.PokemonId},{PokemonInfo.GetLevel(pokemon)},{pokemon.Cp},{PokemonInfo.CalculatePokemonPerfection(pokemon)},{pokemon.Stamina},{pokemon.StaminaMax},{pokemon.Move1},{pokemon.Move2},{PokemonInfo.GetCandy(pokemon, myPokemonFamilies, myPokeSettings)},{pokemon.OwnerName},{pokemon.Origin},{pokemon.HeightM},{pokemon.WeightKg},{pokemon.IndividualAttack},{pokemon.IndividualDefense},{pokemon.IndividualStamina},{pokemon.CpMultiplier},{pokemon.BattlesAttacked},{pokemon.BattlesDefended},{pokemon.CreationTimeMs},{pokemon.NumUpgrades},{pokemon.AdditionalCpMultiplier},{pokemon.Favorite},{pokemon.Nickname}",
dumpFileName);
}
}
await Task.Delay(500);
Expand Down

0 comments on commit 612b2a8

Please sign in to comment.