Class Food

java.lang.Object
  |
  +--Food

public class Food
extends Object


Field Summary
static int TYPE_BAD
          food_type: bad food
static int TYPE_BORDER
          food_type: border
static int TYPE_GOOD
          food_type: good food
static int TYPE_MAXFOOD
          food_type: the best-energy food
static int TYPE_MINFOOD
          food_type: the lowest-energy food
static int TYPE_NOTHING
          food_type: no food
static int TYPE_VERYBAD
          food_type: very bad food
static int TYPE_VERYGOOD
          food_type: very good food
 
Constructor Summary
Food()
          creates a TYPE_NOTHING food
Food(int type)
          creates food of a special type
 
Method Summary
 void clear()
          returns the foodtype to TYPE_NOTHING
 Color getcolor()
          returns the color of this food
 int getenergy()
          returns the energy level of this food
 int gettype()
          returns the type of this food
 void settype(int type)
          sets the foodtype of this food
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_BORDER

public static final int TYPE_BORDER
food_type: border

TYPE_VERYBAD

public static final int TYPE_VERYBAD
food_type: very bad food

TYPE_BAD

public static final int TYPE_BAD
food_type: bad food

TYPE_NOTHING

public static final int TYPE_NOTHING
food_type: no food

TYPE_GOOD

public static final int TYPE_GOOD
food_type: good food

TYPE_VERYGOOD

public static final int TYPE_VERYGOOD
food_type: very good food

TYPE_MINFOOD

public static final int TYPE_MINFOOD
food_type: the lowest-energy food

TYPE_MAXFOOD

public static final int TYPE_MAXFOOD
food_type: the best-energy food
Constructor Detail

Food

public Food()
creates a TYPE_NOTHING food

Food

public Food(int type)
creates food of a special type
Parameters:
type - type of this food
Method Detail

settype

public void settype(int type)
sets the foodtype of this food
Parameters:
type - type of this food

gettype

public int gettype()
returns the type of this food
Returns:
food type

getcolor

public Color getcolor()
returns the color of this food
Returns:
food color

getenergy

public int getenergy()
returns the energy level of this food
Returns:
energy level

clear

public void clear()
returns the foodtype to TYPE_NOTHING