Class Microbe

java.lang.Object
  |
  +--Microbe

public class Microbe
extends Object


Constructor Summary
Microbe(PlayField pf, int x, int y, int start_energy, int start_energyloss)
          creates a new microbe
 
Method Summary
 int getcolor()
          returns the "color" of this microbe, the "color" depends on its current energy level
 int getenergy()
          returns the current energy level of this microbe
 int getenergyloss()
          returns the energy loss per step
 int getx()
          returns the current x position of the microbe
 int gety()
          returns the current y position of the microbe
 void setenergy(int new_energy)
          sets the energy level to a new value
 void setenergyloss(int new_energyloss)
          sets the energy loss per step to a new value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Microbe

public Microbe(PlayField pf,
               int x,
               int y,
               int start_energy,
               int start_energyloss)
creates a new microbe
Parameters:
pf - playfield where this microbe "lives"
x - x startposition
y - y startposition
start_energy - startenergy
start_energyloss - energy loss per step
Method Detail

getenergy

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

setenergy

public void setenergy(int new_energy)
sets the energy level to a new value
Parameters:
new_energy - new energy level

getenergyloss

public int getenergyloss()
returns the energy loss per step
Returns:
energy loss per step

setenergyloss

public void setenergyloss(int new_energyloss)
sets the energy loss per step to a new value
Parameters:
new_energyloss - energyloss per step

getx

public int getx()
returns the current x position of the microbe
Returns:
x position

gety

public int gety()
returns the current y position of the microbe
Returns:
y position

getcolor

public int getcolor()
returns the "color" of this microbe, the "color" depends on its current energy level
Returns:
"color" value in the range from 0 to 255