Class HumanPlayer

  • All Implemented Interfaces:
    breitband.preset.Player

    public class HumanPlayer
    extends SPlayer
    Class for Human players
    Author:
    Klara Schöbel
    • 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 player
        name - name of player
        read - XML reader
        con - available contracts
        num - number of players
        gui - 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 also GameWindow.requestMoveFromCurrentHumanPlayer()),
        updating its own board and then returning the move given by GUI
        Specified by:
        request in interface breitband.preset.Player
        Specified by:
        request in class SPlayer
        Returns:
        a move given by GUI