Skip to content
This repository has been archived by the owner on Oct 7, 2021. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/Beta-Build'
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian committed Aug 10, 2016
2 parents 3e27588 + 102f950 commit 89f0e33
Show file tree
Hide file tree
Showing 7 changed files with 665 additions and 287 deletions.
298 changes: 173 additions & 125 deletions PokemonGo/RocketAPI/Window/MainForm.Designer.cs

Large diffs are not rendered by default.

378 changes: 286 additions & 92 deletions PokemonGo/RocketAPI/Window/MainForm.cs

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions PokemonGo/RocketAPI/Window/MainForm.resx
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>132, 18</value>
</metadata>
<metadata name="cmsPokemonList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>540, 18</value>
</metadata>
<metadata name="largePokemonImageList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>357, 18</value>
</metadata>
Expand Down
1 change: 1 addition & 0 deletions PokemonGo/RocketAPI/Window/PokemonGo.RocketBot.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="PokemonObject.cs" />
<Compile Include="RouteOptimizer.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
Expand Down
108 changes: 108 additions & 0 deletions PokemonGo/RocketAPI/Window/PokemonObject.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
using POGOProtos.Data;
using POGOProtos.Enums;
using POGOProtos.Networking.Responses;
using System.Collections.Generic;

namespace PokemonGo.RocketAPI.Window
{
public class PokemonObject
{
private static bool initialized;
public static Dictionary<PokemonId, int> candyToEvolveDict = new Dictionary<PokemonId, int>();

public PokemonObject(PokemonData pokemonData)
{
PokemonData = pokemonData;
}

public PokemonData PokemonData { get; }

public ulong Id
{
get { return PokemonData.Id; }
}

public PokemonId PokemonId
{
get { return PokemonData.PokemonId; }
}

public int Cp
{
get { return PokemonData.Cp; }
}

public int IndividualAttack
{
get { return PokemonData.IndividualAttack; }
}

public int IndividualDefense
{
get { return PokemonData.IndividualDefense; }
}

public int IndividualStamina
{
get { return PokemonData.IndividualStamina; }
}

public float GetIV
{
get { return (IndividualAttack + IndividualDefense + IndividualStamina) / 45f; }
}

public string Nickname {
get { return PokemonData.Nickname; }
}

public int Candy { get; set; } = 0;

public int CandyToEvolve
{
get
{
if (candyToEvolveDict.ContainsKey(PokemonData.PokemonId))
{
return candyToEvolveDict[PokemonData.PokemonId];
}
return 0;
}
}

public int EvolveTimes
{
get
{
if (CandyToEvolve > 0)
{
return Candy/CandyToEvolve;
}
return 0;
}
}

public bool CanEvolve
{
get { return EvolveTimes > 0; }
}

public static void Initilize(DownloadItemTemplatesResponse itemtemplates)
{
if (!initialized)
{
foreach (var t in itemtemplates.ItemTemplates)
{
if (t != null)
{
if (t.PokemonSettings != null)
{
candyToEvolveDict.Add(t.PokemonSettings.PokemonId, t.PokemonSettings.CandyToEvolve);
}
}
}
initialized = true;
}
}
}
}
2 changes: 1 addition & 1 deletion PokemonGo/RocketAPI/Window/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

[assembly: AssemblyVersion("1.8.0.1")]
[assembly: AssemblyVersion("1.8.1.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Loading

0 comments on commit 89f0e33

Please sign in to comment.