Skip to content

Commit

Permalink
Get LevelUp Rewards
Browse files Browse the repository at this point in the history
  • Loading branch information
cawk committed Aug 8, 2016
1 parent ab5d799 commit 58cfe37
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
13 changes: 13 additions & 0 deletions PoGo.NecroBot.Logic/Inventory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,19 @@ public async Task<IEnumerable<PokemonData>> GetPokemonToEvolve(IEnumerable<Pokem
return pokemonToEvolve;
}

public async Task<LevelUpRewardsResponse> GetLevelUpRewards(int level)
{
var GetData = await _client.Player.GetPlayer();



var ClientLevel = await _client.Player.GetPlayerProfile(GetData.PlayerData.Username);
var Rewards = await _client.Player.GetLevelUpRewards(level);

return Rewards;

}

public async Task<List<PokemonData>> GetPokemonToUpgrade()
{
var upgradePokemon = new List<PokemonData>();
Expand Down
15 changes: 14 additions & 1 deletion PoGo.NecroBot.Logic/Utils/Statistics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using PoGo.NecroBot.Logic.Logging;
using POGOProtos.Inventory.Item;
using Google.Protobuf.Collections;
using PoGo.NecroBot.Logic.State;

#endregion

Expand Down Expand Up @@ -86,7 +87,13 @@ public StatsExport GetCurrentInfo(Inventory inventory)
}
}
}

var Result2 = Execute(inventory).Result;
LevelForRewards = stat.Level;
if (Result2.ToString().ToLower().Contains("success"))
{
string[] tokens = Result2.Result.ToString().Split(new[] { "itemId" }, StringSplitOptions.None);
Logging.Logger.Write("Items Awarded:" + Result2.ItemsAwarded.ToString());
}
output = new StatsExport
{
Level = stat.Level,
Expand All @@ -99,6 +106,12 @@ public StatsExport GetCurrentInfo(Inventory inventory)
return output;
}

public async Task<LevelUpRewardsResponse> Execute(ISession ctx)
{
var Result = await ctx.Inventory.GetLevelUpRewards(LevelForRewards);
return Result;
}

public async Task<LevelUpRewardsResponse> Execute( Inventory inventory )
{
var Result = await inventory.GetLevelUpRewards( inventory );
Expand Down

0 comments on commit 58cfe37

Please sign in to comment.