-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRoom.java
More file actions
69 lines (56 loc) · 1.46 KB
/
Room.java
File metadata and controls
69 lines (56 loc) · 1.46 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
import java.util.ArrayList;
import java.awt.*;
/*
* Room class that handles room attributes
*/
public class Room {
private final int roomId;
private final int width;
private final int height;
// GameObjects within Room
private final ArrayList<Obstacle> obstacles;
private final ArrayList<Door> doors;
private final ArrayList<Player> players;
private boolean isBombRoom;
Room(int roomId, int width, int height, ArrayList<Obstacle> obstacles, ArrayList<Door> doors){
this.roomId = roomId;
this.width = width;
this.height = height;
this.obstacles = obstacles;
this.doors = doors;
this.players = new ArrayList<>();
}
public int getWidth(){
return this.width;
}
public int getHeight() {
return this.height;
}
public int getId(){
return this.roomId;
}
public void setBombRoom(){
this.isBombRoom = true;
}
public int[] getSpawn() {
return null;
}
public void addPlayer(Player player){
this.players.add(player);
}
public Player removePlayer(Player player){
if(this.players.remove(player)){
return player;
}
return null;
}
public ArrayList<Obstacle> getObstacles(){
return this.obstacles;
}
public ArrayList<Door> getDoors() {
return this.doors;
}
public ArrayList<Player> getPlayers(){
return this.players;
}
}