mechanics
Class PokemonType

java.lang.Object
  extended by mechanics.PokemonType
All Implemented Interfaces:
java.io.Serializable

public class PokemonType
extends java.lang.Object
implements java.io.Serializable

This class represents the type of a pokemon or of a move.

See Also:
Serialized Form

Field Summary
static PokemonType T_BUG
           
static PokemonType T_DARK
           
static PokemonType T_DRAGON
           
static PokemonType T_ELECTRIC
           
static PokemonType T_FIGHTING
           
static PokemonType T_FIRE
           
static PokemonType T_FLYING
           
static PokemonType T_GHOST
           
static PokemonType T_GRASS
           
static PokemonType T_GROUND
           
static PokemonType T_ICE
           
static PokemonType T_NORMAL
          Constants representing each of the types.
static PokemonType T_POISON
           
static PokemonType T_PSYCHIC
           
static PokemonType T_ROCK
           
static PokemonType T_STEEL
           
static PokemonType T_TYPELESS
           
static PokemonType T_WATER
           
 
Method Summary
 boolean equals(java.lang.Object type)
          Return whether this type is equal to the test type.
 double getMultiplier(PokemonType type)
          Get the multiplier when attacking a pokemon of a given type.
static PokemonType getType(int i)
          Get a PokemonType object by its id.
static PokemonType getType(java.lang.String type)
          Initialise the type by name.
static PokemonType[] getTypes()
          Return the list of types.
 boolean isSpecial()
          Return whether this type deals special damage.
 java.lang.String toString()
          Get a textual representation of this type.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

T_NORMAL

public static final PokemonType T_NORMAL
Constants representing each of the types.


T_FIRE

public static final PokemonType T_FIRE

T_WATER

public static final PokemonType T_WATER

T_ELECTRIC

public static final PokemonType T_ELECTRIC

T_GRASS

public static final PokemonType T_GRASS

T_ICE

public static final PokemonType T_ICE

T_FIGHTING

public static final PokemonType T_FIGHTING

T_POISON

public static final PokemonType T_POISON

T_GROUND

public static final PokemonType T_GROUND

T_FLYING

public static final PokemonType T_FLYING

T_PSYCHIC

public static final PokemonType T_PSYCHIC

T_BUG

public static final PokemonType T_BUG

T_ROCK

public static final PokemonType T_ROCK

T_GHOST

public static final PokemonType T_GHOST

T_DRAGON

public static final PokemonType T_DRAGON

T_DARK

public static final PokemonType T_DARK

T_STEEL

public static final PokemonType T_STEEL

T_TYPELESS

public static final PokemonType T_TYPELESS
Method Detail

getTypes

public static PokemonType[] getTypes()
Return the list of types.


getType

public static PokemonType getType(int i)
Get a PokemonType object by its id.


getType

public static PokemonType getType(java.lang.String type)
Initialise the type by name.


isSpecial

public boolean isSpecial()
Return whether this type deals special damage.


getMultiplier

public double getMultiplier(PokemonType type)
Get the multiplier when attacking a pokemon of a given type.

Parameters:
type - the type of the defending pokemon

equals

public boolean equals(java.lang.Object type)
Return whether this type is equal to the test type.

Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Get a textual representation of this type.

Overrides:
toString in class java.lang.Object