java.lang.Object
model.logic.host.data.Player
- All Implemented Interfaces:
Serializable
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidThe addTile function adds a tile to the tiles' arraylist.The getAllTiles function returns a list of all the tiles in the game.getName()The getName function returns the name of the person.intgetScore()The getScore function returns the score of the player.getTile(char letter) The getTile function takes in a letter and returns the tile with that letter.voidThe setName function sets the name of the person.voidsetScore(int score) The setScore function sets the score of a player.voidThe setTiles function is used to set the tiles of a board.
-
Constructor Details
-
Player
The Player function is a constructor for the Player class. It takes in a String name and sets it as the player's name, initializes their score to 0, and creates an ArrayList of Tiles called tiles.- Parameters:
name- name Set the name of the player
-
-
Method Details
-
getName
The getName function returns the name of the person.- Returns:
- The name of the student
-
setName
The setName function sets the name of the person.- Parameters:
name- name Set the name of the object
-
getScore
public int getScore()The getScore function returns the score of the player.- Returns:
- The score of the player
-
setScore
public void setScore(int score) The setScore function sets the score of a player.- Parameters:
score- score Set the score of the player
-
getTile
The getTile function takes in a letter and returns the tile with that letter.- Parameters:
letter- letter Find the tile with the corresponding letter- Returns:
- The tile with the given letter
-
getAllTiles
The getAllTiles function returns a list of all the tiles in the game.- Returns:
- A list of all the tiles in the game
-
setTiles
The setTiles function is used to set the tiles of a board.- Parameters:
tiles- <Tile> tiles Set the tiles of a board
-
addTile
The addTile function adds a tile to the tiles' arraylist.- Parameters:
tile- tile Add a tile to the tiles arraylist
-