forked from publicissapient-france/code-elevator
-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathPlayerInfo.java
More file actions
32 lines (26 loc) · 963 Bytes
/
PlayerInfo.java
File metadata and controls
32 lines (26 loc) · 963 Bytes
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
package elevator.server;
import java.io.Serializable;
public class PlayerInfo implements Serializable {
public final String pseudo;
public final String email;
public final int score;
public final int averageScore;
public final int[] peopleWaitingTheElevator;
public final int elevatorAtFloor;
public final int peopleInTheElevator;
public final boolean doorIsOpen;
public final String lastErrorMessage;
public final String state;
public PlayerInfo(ElevatorGame game, Player player) {
email = player.email;
pseudo = player.pseudo;
score = game.score();
averageScore = game.averageScore();
peopleWaitingTheElevator = game.waitingUsersByFloors();
elevatorAtFloor = game.floor();
peopleInTheElevator = game.travelingUsers();
doorIsOpen = game.doorIsOpen();
lastErrorMessage = game.lastErrorMessage;
state = game.state.toString();
}
}