public DamageBuff(PokeAPI.Move movetype, PokeAPI.Pokemon pokemontype) { MoveType = movetype; PokemonType = pokemontype; DamageModifier = 1; TypeWeaknessMap BattleTypes = new TypeWeaknessMap(); TypeComparison(BattleTypes); }
/* The DownloadMoves() function downloads the first 621 (which is currently all) the moves from PokeAPI. * It is asynchronous as the API wrapper uses an await keyword to download from the API. */ public static async void DownloadMoves() { for (int i = 1; i <= 621; i++) { /* Each move is downloaded from PokeAPI using DataFetcher.GetApiObject<T>(). */ api.Move m = await api.DataFetcher.GetApiObject <api.Move>(i); /* The array of move flags is created and set with every bit as false for now. * The flags are not in the API so I have to make them here. */ bool[] flags = new bool[20]; for (int j = 0; j < 20; j++) { flags[j] = false; } /* A new Move is generated and added using the data from the PokeAPI Move object. In several cases, the NullToZero() function is used for conversion. */ MoveManager.Moves.Add(m.Names[0].Name, new Move(m.Names[0].Name, (byte)NullToZero(m.Power), (byte)NullToZero(m.Accuracy), (sbyte)m.Priority, ParseEnum <MoveCategory>(m.DamageClass.Name), ParseEnum <PkmnType>(m.Type.Name), (byte)NullToZero(m.PP), flags)); Console.WriteLine("Move #" + i + " (" + m.Name + ") has been added."); } }
public void Fetch(int MoveID) { Task <PokeAPI.Move> MoveTask = FetchMove(MoveID); move = MoveTask.Result; }
public void Fetch(String MoveName) { Task <PokeAPI.Move> MoveTask = FetchMove(MoveName); move = MoveTask.Result; }