-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWorldStrip.java
More file actions
64 lines (51 loc) · 1.36 KB
/
WorldStrip.java
File metadata and controls
64 lines (51 loc) · 1.36 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
import java.util.HashSet;
import java.util.Collection;
/**
* Write a description of class WorldStrip here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class WorldStrip
{
private Block block;
private HashSet<Entity> entities;
public WorldStrip(Block startBlock) {
block = startBlock;
entities = new HashSet<Entity>();
}
public WorldStrip(Block startBlock, HashSet<Entity> startEntities) {
block = startBlock;
entities = startEntities;
}
public WorldStrip(Block startBlock, Entity startEntity) {
block = startBlock;
entities = new HashSet<Entity>();
entities.add(startEntity);
}
public Block getBlock() {
return block;
}
public void setBlock(Block newBlock) {
block = newBlock;
}
public void addEntity(Entity newEntity) {
entities.add(newEntity);
}
public void addEntities(Collection<Entity> newEntities) {
entities.addAll(newEntities);
}
/*//Doesnt work with current entity equals code
public containsEntity(Entity entity) {
return entities.contains(entitiy);
}
public getEntity(Entity entity) {
}
*/
public HashSet<Entity> getEntities() {
return entities;
}
public void removeEntity(Entity entity) {
entities.remove(entity);
}
}