[ all classes ]
[ it.polimi.ingsw.model ]
Coverage Summary for Class: CurrentPlayer (it.polimi.ingsw.model)
Class | Class, % | Method, % | Line, % |
---|---|---|---|
CurrentPlayer | 100% (1/ 1) | 100% (10/ 10) | 100% (21/ 21) |
1 package it.polimi.ingsw.model;
2
3 class CurrentPlayer {
4
5 /**
6 * Position of players
7 */
8 private int[] positionWorker = new int[2];
9
10 /**
11 * Player's username
12 */
13 private String username;
14
15 /**
16 * Status of the current Player
17 */
18 private StatusPlayer statusPlayer;
19
20 /**
21 * Last god changed that changed status
22 */
23 private God lastGod;
24
25 /**
26 * Current Player
27 */
28 public CurrentPlayer() {
29
30 }
31
32 /**
33 * Current Player's information
34 * @param positionWorker Current Player's workers'positions
35 * @param username Current Player's username
36 * @param statusPlayer Status of the player
37 * @param god Last god on the board that changed his own status
38 */
39 public CurrentPlayer(int[] positionWorker, String username, StatusPlayer statusPlayer, God god) {
40 this.positionWorker = positionWorker;
41 this.username = username;
42 this.statusPlayer = statusPlayer;
43 this.lastGod = god;
44 }
45
46 /**
47 * To set workers' position
48 * @param positionWorker Current position of the worker
49 */
50 public void setPositionWorker(int[] positionWorker) {
51 this.positionWorker = positionWorker;
52 }
53
54 /**
55 * Set the current players's username
56 * @param username player's username
57 */
58 public void setCurrentPlayer(String username) {
59 this.username = username;
60 }
61
62 /**
63 * Set the current player's status
64 * @param statusPlayer player's status
65 */
66 public void setStatusPlayer(StatusPlayer statusPlayer) {
67 this.statusPlayer = statusPlayer;
68 }
69
70 /**
71 * Set the last god that changed his own status
72 * @param god last god that changed his own status
73 */
74 public void setLastGod(God god) {
75 lastGod = god;
76 }
77
78 /**
79 * Get workers'positions
80 * @return positions of the workers
81 */
82 public int[] getPositionWorker() {
83 return positionWorker;
84 }
85
86 /**
87 * Get the current player
88 * @return the current player's username
89 */
90 public String getCurrentPlayer() {
91 return username;
92 }
93
94 /**
95 * Get the current player's status
96 * @return current player's status
97 */
98 public StatusPlayer getStatusPlayer() {
99 return statusPlayer;
100 }
101
102 /**
103 * Get the last god that changed his own status
104 * @return Last god that changed his own status
105 */
106 public God getLastGod() {
107 return lastGod;
108 }
109 }