public int GetMoveWithoutType(List <PokémonAPI.Move> moves, PokémonAPI.Type type) { //Return the first move encountered that DOES NOT have a given type //Iterate through the moves (4 moves assumed) for (int i = 0; i < 4; ++i) { if (moves[i].AttackType != type) { //Type found return(i); } } //Type not found return(-1); }
public int GetMoveWithType(List <PokémonAPI.Move> moves, PokémonAPI.Type type) { //Return the first move encountered that has a given type //Iterate through the moves (4 moves assumed) for (int i = 0; i < 4; ++i) { //Console.WriteLine("Comparing type " + moves[i].AttackType + " with " + type + "..."); if (moves[i].AttackType == type) { //Type found //Console.WriteLine("Match!"); return(i); } } //Type not found //Console.WriteLine("No match"); return(-1); }