-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlayer.java
More file actions
87 lines (77 loc) · 1.82 KB
/
Player.java
File metadata and controls
87 lines (77 loc) · 1.82 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
/**
* class which represents the Player with its basic methods
*/
public class Player {
private int currentGold;
private int row;
private int column;
private char currentTile;
/**
* Constructor which also sets the
* player's current gold value to 0.
*/
public Player (){
currentGold = 0;
}
/**
* Increases the gold value
* the player has by 1.
*/
public void addGold(){
currentGold++;
}
/**
* Sets the row value coordinate
* on which the player is.
* @param row row coordinate
*/
public void setRow(int row) {
this.row = row;
}
/**
* Sets the column value coordinate
* on which the player is.
* @param column column coordinate
*/
public void setColumn(int column) {
this.column = column;
}
/**
* Sets the tile on which the player
* is currently sitting.
* @param tile character from map on which player
is currently sitting
*/
public void setCurrentTile(char tile){
currentTile = tile;
}
/**
* Returns the gold value the player has.
* @return gold value
*/
public int getCurrentGold() {
return currentGold;
}
/**
* Returns the tile on which the player is.
* @return character from map on which player
is currently sitting
*/
public char getCurrentTile(){
return currentTile;
}
/**
* Returns the row coordinate.
* @return row coordinate
*/
public int getRow() {
return row;
}
/**
* Returns the column coordinate
* @return column coordinate
*/
public int getColumn() {
return column;
}
}