edu.tamu.gamebots.humanbot
Class HumanBot

java.lang.Object
  |
  +--edu.isi.gamebots.client.Bot
        |
        +--edu.tamu.gamebots.humanbot.HumanBot
All Implemented Interfaces:
GamebotsConstants

public class HumanBot
extends Bot

A user interface that allows users to view the messages sent to the bot and to and send messages (actions) to the server.

Author:
rtr7684

Nested Class Summary
 
Nested classes inherited from class edu.isi.gamebots.client.GamebotsConstants
GamebotsConstants.TeamColorMap
 
Field Summary
protected  JTable table
           The table that will hold the parsed visual infromation
protected  boolean updateTable
           Flag to update the table during the next synchronous block
 
Fields inherited from class edu.isi.gamebots.client.Bot
client, clientListener, eventProcessor, log
 
Fields inherited from interface edu.isi.gamebots.client.GamebotsConstants
ACTOR_CLASS, ACTOR_ID, ACTOR_REACHABLE, ARG_ALT, ARG_AMOUNT, ARG_GLOBAL, ARG_TARGET, ARG_TEXT, ARG_WALK, BEG, BUMP, CHANGEWEAPON, CHECKREACH, DAMAGE, DEATH_DAMAGE_TYPE, DEATH_KILLER, DEFAULT_BOT_PORT, DEFAULT_VIZ_PORT, DIE, DOM, DOMPOINTS, END, FALSE, FINISHED, GAMESTATE, GETPATH, INFO, INIT, INV, ITEM, ITEM_ID, JUMP, KILL, LOCATION, MESSAGE, MOV, NAV, NODE_DOMINATION, NODE_INVENTORY, NODE_MOVER, NODE_NAVIGATION, OWNER, PATH, PING, PLAYER, PLAYER_AMMO, PLAYER_ARMOR, PLAYER_HEALTH, PLAYER_NAME, PLAYER_RADIUS, PLAYER_TEAM, PLAYER_WEAPON, PONG, ROTATE, ROTATION, RUNTO, SEE, SELF, SETWALK, SHOOT, STOP, STOP_SHOOT, STRAFE, TEAM_ANY, TEAM_BLUE, TEAM_GOLD, TEAM_GREEN, TEAM_NONE, TEAM_RED, TRUE, TURNTO, VELOCITY, WALL, WEAPON_1, WEAPON_2
 
Constructor Summary
HumanBot()
           Creates a new instance of HumanBot
HumanBot(UnrealMessageTextArea syncArea, UnrealMessageTextArea asyncArea)
           Creates a new HumanBot.
 
Method Summary
 void addJTableForMessages(JTable msgTable)
           Set the table that will hold the parsed visual node information from sync messages.
protected  void connected()
           Sends a message to the interface saying that the bot was connected.
protected  void disconnected()
           Sends a message to the interface saying that the bot was disconnected.
 JComponent getView()
           Returns a BotPanel for display.
 void init()
           Sends all messages sent to the server to the debug log.
protected  void receivedAsyncMessage(Message message)
           If it is an NFO message, initializes the bot with the world.
protected  void receivedSyncMessage(MessageBlock message)
           Updates the interface when a new sync.
 void setASyncMessagesTextArea(UnrealMessageTextArea asyncArea)
           Sets the UnrealMessageTextArea for the bot where the asynchronous messages will be displayed.
 void setCurrentBotStatePanel(CurrentBotStatePanel statePanel)
           Sets the CurrentBotStatePanel for this bot.
 void setSyncMessagesTextArea(UnrealMessageTextArea syncArea)
           Sets the UnrealMessageTextArea for the bot where the synchronous messages will be displayed.
protected  void setUpdateTable()
           Flag the table to be updated on the next Synch.
 
Methods inherited from class edu.isi.gamebots.client.Bot
changeWeapon, checkReach, checkReach, connect, destroy, destroyImpl, disconnect, getClient, getInitialTeam, getLog, getName, getPath, init, jump, parseVector, receivedError, rotate, runTo, runTo, say, setName, setWalk, shoot, shoot, shoot, stop, stopShoot, strafe, turnTo, turnToLoc, turnToLoc
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

table

protected JTable table

The table that will hold the parsed visual infromation


updateTable

protected boolean updateTable

Flag to update the table during the next synchronous block

Constructor Detail

HumanBot

public HumanBot()

Creates a new instance of HumanBot


HumanBot

public HumanBot(UnrealMessageTextArea syncArea,
                UnrealMessageTextArea asyncArea)

Creates a new HumanBot.

Parameters:
syncArea - The TextPanel that will hold the synchronous messages
asyncArea - The TextPanel that will hold the asynchronous messages
Method Detail

setCurrentBotStatePanel

public void setCurrentBotStatePanel(CurrentBotStatePanel statePanel)

Sets the CurrentBotStatePanel for this bot. This shows the current stats for the bot

Parameters:
statePanel - The CurrentBotStatePanel for this bot

setSyncMessagesTextArea

public void setSyncMessagesTextArea(UnrealMessageTextArea syncArea)

Sets the UnrealMessageTextArea for the bot where the synchronous messages will be displayed.

Parameters:
syncArea - The UnrealMessageTextArea for the bot where the synchronous messages will be displayed.

setASyncMessagesTextArea

public void setASyncMessagesTextArea(UnrealMessageTextArea asyncArea)

Sets the UnrealMessageTextArea for the bot where the asynchronous messages will be displayed.

Parameters:
asyncArea - The UnrealMessageTextArea for the bot where the asynchronous messages will be displayed.

addJTableForMessages

public void addJTableForMessages(JTable msgTable)

Set the table that will hold the parsed visual node information from sync messages.

Parameters:
msgTable - JTable that holds the information.

receivedAsyncMessage

protected void receivedAsyncMessage(Message message)

If it is an NFO message, initializes the bot with the world. Otherwise, it prints the message to the async message text panel.

Specified by:
receivedAsyncMessage in class Bot
Parameters:
message - The ASynchronous message to handle.

setUpdateTable

protected void setUpdateTable()

Flag the table to be updated on the next Synch. message block.


getView

public JComponent getView()

Returns a BotPanel for display. Called by BotRunnerApp

Overrides:
getView in class Bot
Returns:
The HumanBotPanel of this bot

connected

protected void connected()

Sends a message to the interface saying that the bot was connected. This is an event handling method in Bot.

Overrides:
connected in class Bot

disconnected

protected void disconnected()

Sends a message to the interface saying that the bot was disconnected. This is an event handling method in Bot.

Overrides:
disconnected in class Bot

receivedSyncMessage

protected void receivedSyncMessage(MessageBlock message)

Updates the interface when a new sync. message is received.

Specified by:
receivedSyncMessage in class Bot
Parameters:
message - The Message object to handle

init

public void init()

Sends all messages sent to the server to the debug log. If using BotRunnerApp, then this is sent to the lower half of the split pane in the display

Overrides:
init in class Bot