Package breitband.game.players
Class HumanPlayer
- java.lang.Object
-
- breitband.game.players.SPlayer
-
- breitband.game.players.HumanPlayer
-
- All Implemented Interfaces:
breitband.preset.Player
public class HumanPlayer extends SPlayer
Class for Human players- Author:
- Klara Schöbel
-
-
Constructor Summary
Constructors Constructor Description HumanPlayer(int id, java.lang.String name, java.io.Reader read, breitband.preset.ImmutableList<java.lang.String> con, int num, breitband.preset.PlayerGUIAccess gui)
constructs a new human player with an id, a name, a XMLReader, available contracts, and the number of players
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description breitband.preset.Move
request()
this method returns the move made by a humanPlayer, by calling the request Method from GUI (see alsoGameWindow.requestMoveFromCurrentHumanPlayer()
),
updating its own board and then returning the move given by GUI-
Methods inherited from class breitband.game.players.SPlayer
cityOnRoute, contractExists, distanceNotPossibleWithAvailableResources, distancePossibleWithType, getBoard, getName, getPlayerId, getScore, illegalBorderCrossing, illegalCableCrossings, init, inSameRegion, routePossible, update, verifyGame
-
-
-
-
Constructor Detail
-
HumanPlayer
public HumanPlayer(int id, java.lang.String name, java.io.Reader read, breitband.preset.ImmutableList<java.lang.String> con, int num, breitband.preset.PlayerGUIAccess gui) throws java.lang.Exception
constructs a new human player with an id, a name, a XMLReader, available contracts, and the number of players- Parameters:
id
- id of playername
- name of playerread
- XML readercon
- available contractsnum
- number of playersgui
- instance of PlayerGUIAccess- Throws:
java.lang.Exception
- if config is invalid
-
-
Method Detail
-
request
public breitband.preset.Move request()
this method returns the move made by a humanPlayer, by calling the request Method from GUI (see alsoGameWindow.requestMoveFromCurrentHumanPlayer()
),
updating its own board and then returning the move given by GUI
-
-