-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEntity.java
More file actions
98 lines (77 loc) · 1.92 KB
/
Entity.java
File metadata and controls
98 lines (77 loc) · 1.92 KB
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
package ca.bcit.comp2526.a2a;
import java.awt.Color;
import javax.swing.JLabel;
import javax.swing.JPanel;
/**
* Superclass hosting Herbivore, Plant,
* and other subsequent living/non-organisms.
* @author Kevin Oane
* @version 1.0.
*/
abstract class Entity extends JPanel {
/**
* Generated serialVersionUID.
*/
private static final long serialVersionUID = -1924283204073300101L;
private Cell cell;
private EntityID entID;
private JLabel jeSuis;
private Color color;
/**
* Constructor.
* @param cell
* Cell instance in World.
* @param id
* Designated enumID classification.
* @param ofEnt
* Designated entity color.
*/
Entity(Cell cell, EntityID id, Color color, JLabel sym) {
this.cell = cell;
entID = id;
this.color = color;
jeSuis = sym;
}
/**
* Initializes background color.
*/
public void init() {
cell.setBackground(color);
cell.add(jeSuis);
}
/**
* Updates entity coordinates to cell coordinates.
* @param cell
* cell parameter.
*
*/
public void setCell(final Cell cell) {
this.cell = cell;
}
/**
* Gets cellEntity.
* @return cellEntity.
* This cell.
*/
public Cell getCell() {
return cell;
}
/**
* Returns enum type of entity.
* @return
* entID, an enum type.
*/
public EntityID getEntityID() {
return entID;
}
public JLabel getLabel() {
return jeSuis;
}
public void setLabel(JLabel color) {
jeSuis = color;
}
public void move() {
}
public void givebirth() {
}
}