shoddybattle
Class BattleField.PokemonWrapper

java.lang.Object
  extended by shoddybattle.BattleField.PokemonWrapper
All Implemented Interfaces:
java.lang.Comparable
Enclosing class:
BattleField

protected static class BattleField.PokemonWrapper
extends java.lang.Object
implements java.lang.Comparable

A wrapper for a pokemon and a turn. Can be compared on the basis of move priority, or, failing that, speed.


Method Summary
static int compareSpeed(Pokemon p1, Pokemon p2)
          Compare based on speed.
 int compareTo(java.lang.Object obj)
          Compare this object to another PokemonWrapper.
static int[] sortMoves(Pokemon[] active, BattleTurn[] move)
          Sort pokemon and moves in descending order.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

compareSpeed

public static int compareSpeed(Pokemon p1,
                               Pokemon p2)
Compare based on speed.


compareTo

public int compareTo(java.lang.Object obj)
Compare this object to another PokemonWrapper.

Specified by:
compareTo in interface java.lang.Comparable

sortMoves

public static int[] sortMoves(Pokemon[] active,
                              BattleTurn[] move)
Sort pokemon and moves in descending order. Reorders the elements of the arrays passed in and also returns an array of the indices of the pokemon as rearranged.