-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOrganizm.java
103 lines (75 loc) · 2.18 KB
/
Organizm.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
import java.awt.Color;
public abstract class Organizm {
protected int sila;
protected int inicjatywa;
protected int x;
protected int y;
protected Swiat swiatObiekt;
protected int wiek;
public abstract Organizm urodzenieNowegoOrganizmu(int x, int y, Swiat swiat);
public abstract void setPoprzedniRuch(char ruch);
public abstract void smierc();
public abstract int getOstatniRuch();
public abstract char getZnak();
public abstract Color getKolor();
public abstract String getNazwa();
public abstract String zapiszInfo();
public abstract void akcja();
public abstract void kolizja(Organizm atakujacy);
public abstract void powrotNaPoprzedniePole();
public abstract boolean czyOrganizmToZwierze();
public abstract void komentarzAtak(Organizm atakowany);
public Organizm() {
this.sila = 0;
this.inicjatywa = 0;
this.x = 0;
this.y = 0;
this.swiatObiekt = null;
this.wiek = 0;
}
public Organizm(Swiat swiat, int sila, int inicjatywa, int x, int y) {
this.sila = sila;
this.inicjatywa = inicjatywa;
this.x = x + 1;
this.y = y + 1;
this.swiatObiekt = swiat;
this.wiek = 0;
}
public void setWiek(int wiek) {
this.wiek = wiek;
}
public void setSila(int sila) {
this.sila = sila;
}
public void setInicjatywa(int ini) {
this.inicjatywa = ini;
}
public void setPolozenie(int x, int y) {
this.x = x + 1;
this.y = y + 1;
}
public void setSwiat(Swiat swiat) {
swiatObiekt = swiat;
}
public int getX() {
return this.x;
}
public int getY() {
return this.y;
}
public int getSila() {
return this.sila;
}
public int getInicjatywa() {
return this.inicjatywa;
}
public int getWiek() {
return this.wiek;
}
public Swiat getSwiat() {
return swiatObiekt;
}
public void ustawOrganizmNaMapie() {
swiatObiekt.setPoleMapy(this.x, this.y, this);
}
}