de.htwdd.rosenkoenig.game
Class HumanPlayer

java.lang.Object
  extended by de.htwdd.rosenkoenig.game.Player
      extended by de.htwdd.rosenkoenig.game.HumanPlayer

public class HumanPlayer
extends Player

Human player class.


Field Summary
 
Fields inherited from class de.htwdd.rosenkoenig.game.Player
canMove, cards, game, hasMoved, highscore, knights, name, score
 
Constructor Summary
HumanPlayer()
          Ctor - empty
HumanPlayer(java.lang.String name)
          Ctor - setting the name of the player
 
Method Summary
 org.jdom.Element createXml()
           
protected  void extractPlayer(org.jdom.Element xmlPlayer)
           
 boolean isInteractive()
          Yes, this is an interactive player.
 void turn()
          Must be implemented even though it does nothing because human player interacts with GUI.
 
Methods inherited from class de.htwdd.rosenkoenig.game.Player
equals, getCanMove, getCards, getGame, getHasMoved, getHighscore, getKnights, getName, getNumberOfCards, getScore, loadFromFile, saveToDir, setCanMove, setCards, setGame, setHasMoved, setHighscore, setKnights, setName, setScore, updateHighscore
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HumanPlayer

public HumanPlayer()
Ctor - empty


HumanPlayer

public HumanPlayer(java.lang.String name)
Ctor - setting the name of the player

Parameters:
name - name of the player
Method Detail

extractPlayer

protected void extractPlayer(org.jdom.Element xmlPlayer)
Specified by:
extractPlayer in class Player
Parameters:
xmlPlayer - player's XML snippet to contain attributes. Extract human player's attributes from xmlPlayer.

createXml

public org.jdom.Element createXml()
Specified by:
createXml in class Player
Returns:
jdom element to contain player's attribute. Create human player's XML snippet to save to file.

turn

public void turn()
Must be implemented even though it does nothing because human player interacts with GUI.

Specified by:
turn in class Player

isInteractive

public boolean isInteractive()
Yes, this is an interactive player.

Specified by:
isInteractive in class Player
Returns:
false if some kind of AI-player, true otherwise.