-
Notifications
You must be signed in to change notification settings - Fork 1
/
Player.java
116 lines (89 loc) · 2.2 KB
/
Player.java
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
/**
* This class repersent a player int Run class
* it holds the player score, ID and player character
*
* its extends from the person class
*
*
*
* @author Mohammad Mahdi Malmasi
* @version 0.1.0
*
* @see Person
*/
public class Player extends Person
{
/* Feilds */
// the score of the player
private int score;
// the id of the player in the game
private int playerID;
// the character of the player
private char playerCharacter;
/* Constructor */
/**
* Creat a new Player with given details
*
* @param firstName : the first name of the player
* @param lastName : the last name of the player
* @param age : the age of the player
* @param playerID : player ID
* @param playerCharacter : the character of the player in game
* @param gender : the gender of the player
*/
public Player(String firstName, String lastName, int age, int playerID, char playerCharacter, String gender)
{
super(firstName, lastName, age, gender);
this.score = 0;
this.playerID = playerID;
this.playerCharacter = playerCharacter;
}
/* Methods */
// * setter methods *
/**
* set the score of the player
* @param score : the score of player to set
*/
public void setScore(int score)
{
this.score = score;
}
/**
* set the ID of the player
* @param playerID : the ID of palyer to set
*/
public void setPlayerID(int playerID)
{
this.playerID = playerID;
}
/**
* set the character of the player
* @param playerCharacter : the Character of player to set
*/
public void setPlayerCharacter(char playerCharacter)
{
this.playerCharacter = playerCharacter;
}
// * getter methods *
/**
* @return : the score of the player
*/
public int getScore()
{
return score;
}
/**
* @return : the ID of the player
*/
public int getPlayerID()
{
return playerID;
}
/**
* @return : the Character of the player
*/
public char getPlayerCharacter()
{
return playerCharacter;
}
}