|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--organisms.organisms
|
+--organisms.animals
|
+--organisms.carnivores
|
+--organisms.tiger
H klash twn tigers.
Invariant: Prepei na thrountai oles oi invariant synthikes ths klashs carnivores. Dhladh mia egkyrh tiger prepei na einai ena egkyro sarkofago zwo.
Statika pedia ths klashs: alive_tigers: Poses tigers einai zwntanes, dead_tigers: Poses tigers exoun pethanei
| Field Summary |
| Fields inherited from class organisms.carnivores |
alive_carnivores, dead_carnivores |
| Fields inherited from class organisms.animals |
alive_animals, dead_animals, eatenThisWeek, foodPerWeek |
| Fields inherited from class organisms.organisms |
age, alive_organisms, dead_organisms, energy, growth_rate, im, isChosen, position |
| Constructor Summary | |
tiger(int x,
int y,
javax.swing.ImageIcon im)
Constructor ths klashs tigers. |
|
| Method Summary | |
static int |
alive_tigers()
Epistrefei ton arithmo twn zwntanwn tigers Accesor - Selector. |
static int |
dead_tigers()
Epistrefei ton arithmo twn nekrwn tigers Accesor - Selector. |
void |
die()
Kaleitai otan pethainei mia tiger kai meiwnei oles tis static metavlites pou deixnoun tous zwntanous organismous twn kathgoriwn pou auto anhkei, enw antistoixa auksanei oles tis static metavlites pou deixnoun tou nekrous organismous twn kathgoriwn autwn. |
static void |
initStats()
Arxikopoiei ta statistika se authn thn klash. |
| Methods inherited from class organisms.carnivores |
alive_carnivores, dead_carnivores, eat |
| Methods inherited from class organisms.animals |
alive_animals, dead_animals, eatenThisWeek, foodPerWeek, increase_eatenThisWeek, move, reset_eatenThisWeek, restoreEnergy |
| Methods inherited from class organisms.organisms |
age, alive_organisms, choose, dead_organisms, decrease_energy, draw, energy, growth_rate, increase_age, increase_energy, isAlive, position |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public tiger(int x,
int y,
javax.swing.ImageIcon im)
Precondition: Prepei na dwthei egkyrh thesh, dhaldh ta x,y na einai x>=0 , y>=0 x kai y mesa sta oria tou xarth kai sthn thesh auth na mhn yparxei allos organismos.
Postcondition: Dhmiourgeitai mia nea tiger me to orismeno growth_rate, foodPerWeek kai arxiko energy sthn thesh x,y.
x - H syntetagmenh x ths theshs pou theloume na eisagoume th nea tiger.y - H syntetagmenh y ths theshs pou theloume na eisagoume th nea tiger.im - To eikonidio ths tigrhs.| Method Detail |
public static int alive_tigers()
Postcondition: Epistrefei ton arithmo twn zwntanwn tigers
public static int dead_tigers()
Postcondition: Epistrefei ton arithmo twn nekrwn tigers
public void die()
Precondition: O organismos prepei na exei pethanei, dhladh !this.isAlive().
Postcondition: Meiwnetai kata 1 to plhthos twn zwntanwn organismwn kai auksanetai kata 1 to plhthos twn nekrwn organismwn. (oi static metavlites olwn twn kathgoriwn pou anhkei o organismos pou pethainei)
die in class organismspublic static void initStats()
Postcondition: Arxikopoiei ta statistika se authn thn klash.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||