Class Helper

java.lang.Object
  |
  +--Helper

public class Helper
extends java.lang.Object

This class includes methods for handling communication between the player and the server.


Constructor Summary
Helper()
           
 
Method Summary
static java.lang.String[] GetInfo(java.lang.String filename)
          Given the name of the file the server is communicating through decodes and returns the data of the file in an array, one element for each line.
static int MoveCount(java.lang.String s)
          Given a string of the form (setq move-count x) returns x as an int
static void MoveToServer(aMove m)
          Given an aMove, formats and sends a move message to the server.
static void MoveToServer(java.util.LinkedList jmp)
          Given a jump (LinkedList of Integers) formats and sends a jump message to the server.
static boolean MyTurn(java.lang.String s)
          Given a string of the form (setq whose-turn x), returns true if x is player, false otherwise.
static int TimeLeft(java.lang.String s)
          Given a string of the form (setq time-left x) returns x as an int
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Helper

public Helper()
Method Detail

GetInfo

public static java.lang.String[] GetInfo(java.lang.String filename)
Given the name of the file the server is communicating through decodes and returns the data of the file in an array, one element for each line.


MyTurn

public static boolean MyTurn(java.lang.String s)
Given a string of the form (setq whose-turn x), returns true if x is player, false otherwise.


MoveCount

public static int MoveCount(java.lang.String s)
Given a string of the form (setq move-count x) returns x as an int


TimeLeft

public static int TimeLeft(java.lang.String s)
Given a string of the form (setq time-left x) returns x as an int


MoveToServer

public static void MoveToServer(aMove m)
Given an aMove, formats and sends a move message to the server.


MoveToServer

public static void MoveToServer(java.util.LinkedList jmp)
Given a jump (LinkedList of Integers) formats and sends a jump message to the server.