Package b2p.client

Class B2PTablutClient

  • All Implemented Interfaces:
    java.lang.Runnable

    public class B2PTablutClient
    extends it.unibo.ai.didattica.competition.tablut.client.TablutClient
    This Class extends the TablutClient class to represent a B2P player
    Author:
    Alessandro Buldini, Alessandro Pomponio, Federico Zanini
    See Also:
    TablutClient
    • Constructor Summary

      Constructors 
      Constructor Description
      B2PTablutClient​(java.lang.String player)
      Creates an instance of B2PTablutClient with a given player role, defaults the timeout to 60000 milliseconds and the server IP address to localhost
      B2PTablutClient​(java.lang.String player, int timeout)
      Creates an instance of B2PTablutClient with a given player role and timeout.
      B2PTablutClient​(java.lang.String player, int timeout, java.lang.String ipAddress)
      Creates an instance of B2PTablutClient with the given arguments
      B2PTablutClient​(java.lang.String player, java.lang.String ipAddress)
      Creates an instance of B2PTablutClient with the given arguments and a default timeout set to 60000 milliseconds
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void run()
      Starts the client
      • Methods inherited from class it.unibo.ai.didattica.competition.tablut.client.TablutClient

        declareName, getCurrentState, getName, getPlayer, read, setCurrentState, setName, setPlayer, write
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • B2PTablutClient

        public B2PTablutClient​(java.lang.String player,
                               int timeout,
                               java.lang.String ipAddress)
                        throws java.io.IOException
        Creates an instance of B2PTablutClient with the given arguments
        Parameters:
        player - the player name
        timeout - the timeout of every turn
        ipAddress - the server IP address
        Throws:
        java.io.IOException
      • B2PTablutClient

        public B2PTablutClient​(java.lang.String player,
                               java.lang.String ipAddress)
                        throws java.io.IOException
        Creates an instance of B2PTablutClient with the given arguments and a default timeout set to 60000 milliseconds
        Parameters:
        player - the player name
        ipAddress - the server IP address
        Throws:
        java.io.IOException
      • B2PTablutClient

        public B2PTablutClient​(java.lang.String player)
                        throws java.io.IOException
        Creates an instance of B2PTablutClient with a given player role, defaults the timeout to 60000 milliseconds and the server IP address to localhost
        Parameters:
        player - the player name
        Throws:
        java.io.IOException
      • B2PTablutClient

        public B2PTablutClient​(java.lang.String player,
                               int timeout)
                        throws java.io.IOException
        Creates an instance of B2PTablutClient with a given player role and timeout. Defaults the server IP address to localhost.
        Parameters:
        player - the player name
        timeout - the timeout of every turn
        Throws:
        java.io.IOException
    • Method Detail

      • run

        public void run()
        Starts the client