cz.cuni.amis.pogamut.ut2004.bot.command
Class Communication

java.lang.Object
  extended by cz.cuni.amis.pogamut.base.agent.module.AgentModule<AGENT>
      extended by cz.cuni.amis.pogamut.base.agent.module.SensomotoricModule<UT2004Bot>
          extended by cz.cuni.amis.pogamut.ut2004.bot.command.BotCommands
              extended by cz.cuni.amis.pogamut.ut2004.bot.command.Communication
All Implemented Interfaces:
IComponent

public class Communication
extends BotCommands

Class providing Pogamut2 UT2004 communication commands - send message, set dialogs, text bubble...


Field Summary
 
Fields inherited from class cz.cuni.amis.pogamut.base.agent.module.SensomotoricModule
act, worldView
 
Fields inherited from class cz.cuni.amis.pogamut.base.agent.module.AgentModule
agent, controller, eventBus, log
 
Constructor Summary
Communication(UT2004Bot agent, java.util.logging.Logger log)
          Constructor.
 
Method Summary
 void sendGlobalBubbleMessage(java.lang.String text, double fadeOut)
          Sends a global message to UT2004 in-game chat and sets the text bubble visible to all human players above the bot head.
 void sendGlobalTextMessage(java.lang.String text)
          Sends global message to UT2004 in-game chat.
 void sendPrivateBubbleMessage(UnrealId id, java.lang.String text, double fadeOut)
          Sends a private message to desired bot (specified by Id).
 void sendPrivateTextMessage(UnrealId id, java.lang.String text)
          Sends a private message to desired bot (specified by Id).
 void sendTeamBubbleMessage(java.lang.String text, double fadeOut)
          Sends a message to UT2004 in-game chat and sets the text bubble visible to all human players above the bot head.
 void sendTeamTextMessage(java.lang.String text)
          Sends a message to UT2004 in-game chat.
 
Methods inherited from class cz.cuni.amis.pogamut.base.agent.module.AgentModule
cleanUp, getComponentId, getLog, getState, initComponentId, isRunning, kill, pause, reset, resume, start, stop, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Communication

public Communication(UT2004Bot agent,
                     java.util.logging.Logger log)
Constructor. Setups the command module based on given agent and logger.

Parameters:
agent - AbstractUT2004Bot we will send commands for
log - Logger to be used for logging runtime/debug info.
Method Detail

sendGlobalTextMessage

public void sendGlobalTextMessage(java.lang.String text)
Sends global message to UT2004 in-game chat. Everyone will see it, bots will receive information too. (issues GB MESSAGE command)

Parameters:
text - Text of the message to send.
See Also:
sendTeamTextMessage(String), sendPrivateTextMessage(UnrealId, String)

sendTeamTextMessage

public void sendTeamTextMessage(java.lang.String text)
Sends a message to UT2004 in-game chat. Only members of the bot current team will see it. If there are no teams (e.g. no team game, just simple deathmatch) it will be handled as global message. (issues GB MESSAGE command)

Parameters:
text - Text of the message to send.
See Also:
sendGlobalTextMessage(String), sendPrivateTextMessage(UnrealId, String)

sendPrivateTextMessage

public void sendPrivateTextMessage(UnrealId id,
                                   java.lang.String text)
Sends a private message to desired bot (specified by Id). There will be added "Private:" string in front of the message. Works just for GameBots RemoteBots. If the id is not of RemoteBot nothing will happen - the message won't be sent to anyone.

Parameters:
id - Here we can specify Id of the bot, that will receive this message privately.
text - Text of the message to send.
See Also:
sendGlobalTextMessage(String), sendTeamTextMessage(String)

sendGlobalBubbleMessage

public void sendGlobalBubbleMessage(java.lang.String text,
                                    double fadeOut)
Sends a global message to UT2004 in-game chat and sets the text bubble visible to all human players above the bot head. Everyone will receive the message. The bubble will stay as long as specified in fadeOut variable.

Parameters:
text - Text of the message and bubble.
fadeOut - Sets how long the bubble should stay visible (in seconds, counted as 12 + fadeOut seconds - probably due to some UT mechanics). If -1 the bubble won't be shown at all.
See Also:
sendPrivateBubbleMessage(UnrealId, String, double), sendPrivateBubbleMessage(UnrealId, String, double)

sendTeamBubbleMessage

public void sendTeamBubbleMessage(java.lang.String text,
                                  double fadeOut)
Sends a message to UT2004 in-game chat and sets the text bubble visible to all human players above the bot head. The message will be send just to players and bots from the same team (although other human players will still see it through text bubble). If not team game, treated as global message. The bubble will stay as long as specified in fadeOut variable.

Parameters:
text - Text of the message and bubble.
fadeOut - Sets how long the bubble should stay visible (in seconds, counted as 12 + fadeOut seconds - probably due to some UT mechanics). If -1 the bubble won't be shown at all.
See Also:
sendGlobalBubbleMessage(String, double), sendPrivateBubbleMessage(UnrealId, String, double)

sendPrivateBubbleMessage

public void sendPrivateBubbleMessage(UnrealId id,
                                     java.lang.String text,
                                     double fadeOut)
Sends a private message to desired bot (specified by Id). There will be added "Private:" string in front of the message. Also sets the text bubble above the bot head, that will be visible to all human players. The message can be received just by GameBots RemoteBots (although all human players will see it through text bubble).

Parameters:
id - Here we can specify Id of the bot, that will receive this message privately. Other players will see this message through bubble too.
text - Text of the message and bubble.
fadeOut - Sets how long the bubble should stay visible (in seconds, counted as 12 + fadeOut seconds - probably due to some UT mechanics). If -1 the bubble won't be shown at all.
See Also:
sendGlobalBubbleMessage(String, double), sendTeamBubbleMessage(String, double)