glassfrog.server
Class BotManager

java.lang.Object
  extended by glassfrog.server.BotManager

public class BotManager
extends java.lang.Object

The BotManager class is used to start up bots specified in the config file of the server. The BotManager uses a ArrayList passed in the constructor to initiate the execution of the bots to the server to ensure tha the bots are started on the correct socket

Author:
jdavidso

Field Summary
private  java.util.ArrayList<java.lang.String> botList
           
private  java.io.BufferedReader br
           
private  int port
           
private  java.io.PrintWriter pw
           
private  java.net.Socket socket
           
 
Constructor Summary
BotManager(int port)
          The constructor takes a port the Room is on to connect the bots.
 
Method Summary
 void addBot(java.lang.String botString)
          Add a bot to the botList waiting to be executed
 void startBots()
          For each bot in the bot list, get the port the room is listening on and then exec the bot command on the remote or local machine
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

botList

private java.util.ArrayList<java.lang.String> botList

port

private int port

socket

private java.net.Socket socket

pw

private java.io.PrintWriter pw

br

private java.io.BufferedReader br
Constructor Detail

BotManager

public BotManager(int port)
The constructor takes a port the Room is on to connect the bots. Hardcoded to the localhost for now

Parameters:
port - an int value representing the Room we are going to connect to's port value
Method Detail

addBot

public void addBot(java.lang.String botString)
Add a bot to the botList waiting to be executed

Parameters:
botString - A String representing the bot to be executed

startBots

public void startBots()
For each bot in the bot list, get the port the room is listening on and then exec the bot command on the remote or local machine