Class RoboClient

java.lang.Object
  |
  +--RoboClient

public class RoboClient
extends java.lang.Object

This class contains the main method which starts 11 player-Threads and one GUI (if wanted).
The RoboClient must be started like this:
java RoboClient [TEAMNAME [SERVERNAME [SERVERPORT]]] [-gui]

Author:
Patrick Ficher, Wini Appl

Field Summary
private static int bufferIndex
          Counter of the Buffer; points at last message received
private static boolean checkGUIAlert
          set to true, if GUI took over the command line tool-output
private static int checkMode
          Checks if either the Sender is a Player, or message-priority is set to high
private static int countTactics
          Counter to avoid multiple denominations in the Tactics Array; points on most recent message
private static GUI gui
          a GUI object, which is the visualisation of the worldmodel
private static Player[] player
          a Player array with length 11
private static boolean startGUI
          set to true if GUI has been started false if GUI turned off as chosen in the Command Line Tool (see Documentation for further information) initial value = false
private static java.lang.String[][] tactics
          Stores all incoming messages in the following format : [1] = Timecycle message got stored in [2] = Actual message [3] = Player, which sent the message; if "0" message-priority is high
private static java.lang.String teamname
          the teamname
 
Constructor Summary
RoboClient()
          Constructor
 
Method Summary
private static void buffer()
          Buffers the first incoming messages for a timeinterval in which the GUI is not initialized.
Author: Wini Appl
private static void flushBuffer()
          Writes whole buffer-content to the GUI-display, if initialized.
Author: Wini Appl
static void main(java.lang.String[] args)
          This is the main method which starts 11 player-Threads and one GUI (if wanted)
static java.lang.String tellTeamName()
          Just returns the teamname
static void transmitTactics(java.lang.String input, int source)
          Stores all tactical computations, sent by the players and passes the most actual messages on to the GUI.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

player

private static Player[] player
a Player array with length 11

gui

private static GUI gui
a GUI object, which is the visualisation of the worldmodel

teamname

private static java.lang.String teamname
the teamname

startGUI

private static boolean startGUI
set to as chosen in the Command Line Tool (see Documentation for further information) initial value = false
See Also:
main(String[] args)

tactics

private static java.lang.String[][] tactics
Stores all incoming messages in the following format :
See Also:
transmitTactics(String input, int source)

countTactics

private static int countTactics
Counter to avoid multiple denominations in the Tactics Array; points on most recent message
See Also:
transmitTactics(String input, int source)

bufferIndex

private static int bufferIndex
Counter of the Buffer; points at last message received
See Also:
buffer()

checkMode

private static int checkMode
Checks if either the Sender is a Player, or message-priority is set to high

checkGUIAlert

private static boolean checkGUIAlert
set to true, if GUI took over the command line tool-output
Constructor Detail

RoboClient

public RoboClient()
Constructor
Method Detail

tellTeamName

public static java.lang.String tellTeamName()
Just returns the teamname
Returns:
a String containing the teamname

main

public static void main(java.lang.String[] args)
This is the main method which starts 11 player-Threads and one GUI (if wanted)
Parameters:
args[] - Possible arguments for the main method are:
  • teamName: Teamname
  • serverAdress: I.P. or "localhost"
  • serverPort: Port of the Server
  • -gui: when the visualisation (GUI) should be started

Author: Patrick Ficher


transmitTactics

public static void transmitTactics(java.lang.String input,
                                   int source)
Stores all tactical computations, sent by the players and passes the most actual messages on to the GUI. Buffers the remaining ones in case of complications.

Author: Wini Appl

Parameters:
input - message that is to be displayed
source - sender-id of the message

buffer

private static void buffer()
Buffers the first incoming messages for a timeinterval in which the GUI is not initialized.

Author: Wini Appl


flushBuffer

private static void flushBuffer()
Writes whole buffer-content to the GUI-display, if initialized.

Author: Wini Appl