cz.cuni.amis.pogamut.ut2004.teamcomm.bot
Class UT2004TCClient

Package class diagram package UT2004TCClient
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.teamcomm.bot.UT2004TCClient
All Implemented Interfaces:
cz.cuni.amis.pogamut.base.component.IComponent

public class UT2004TCClient
extends cz.cuni.amis.pogamut.base.agent.module.SensomotoricModule<UT2004Bot>


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
UT2004TCClient(UT2004Bot bot, cz.cuni.amis.pogamut.base.communication.worldview.IWorldView teamWorldView)
           
 
Method Summary
protected  void beginMessage(BeginMessage event)
           
protected  void cleanUp()
           
protected  void endMessage(EndMessage event)
           
 cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId getBotId()
           
 int getBotTeam()
           
 TCChannel getChannel(int channelId)
          Returns details about bots/channels connected to the team.
 Set<cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId> getConnectedAllBots()
          Returns set of all bots connected to the same TC server.
 Set<cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId> getConnectedChannelBots(int channelId)
          Returns set of bots connected to the channel of 'channelId' of the same TC server.
 cz.cuni.amis.utils.flag.Flag<Boolean> getConnectedFlag()
           
 Set<cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId> getConnectedTeamBots()
          Returns set of bots of the same team connected to the same TC server.
 List<TCMessage> getMessages()
          TCMessages that came since the last EndMessage, i.e., since the last update, i.e., since the last logic() iteration.
 long getSimTime()
           
 TCTeam getTeam()
          Returns details about bots/channels connected to the team.
 boolean isChannelExist(int channelId)
           
 boolean isConnected()
          Whether your bot is connected to the TC server.
 boolean isConnected(Player bot)
           
 boolean isConnected(cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId botId)
           
 boolean isConnectedToChannel(Player bot, int channelId)
           
 boolean isConnectedToChannel(cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId botId, int channelId)
           
 boolean isConnectedToMyTeam(Player bot)
           
 boolean isConnectedToMyTeam(cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId botId)
           
 TCMinaClient.RequestFuture<TCInfoTeamChannelCreated> requestCreateChannel()
          Request to create a new channel, the channel will gets channelId assigned by TCMinaServer.
 TCMinaClient.RequestFuture<TCInfoTeamChannelDestroyed> requestDestroyChannel(int channelId)
          Request to destroy an existing channel.
 TCMinaClient.RequestFuture<TCInfoStatus> requestGetStatus()
          Request TCInfoStatus update from TCMinaServer.
 TCMinaClient.RequestFuture<TCInfoTeamChannelBotJoined> requestJoinChannel(int channelId)
          Request to join an existing channel.
 TCMinaClient.RequestFuture<TCInfoTeamChannelBotLeft> requestLeaveChannel(int channelId)
          Request to leave an existing channel.
protected  void selfUpdate(cz.cuni.amis.pogamut.base.communication.worldview.object.event.WorldObjectUpdatedEvent<Self> event)
           
 boolean sendToAll(cz.cuni.amis.utils.token.IToken messageType, Serializable data)
           
 boolean sendToAll(TCMessageData data)
           
 boolean sendToAllOthers(cz.cuni.amis.utils.token.IToken messageType, Serializable data)
           
 boolean sendToAllOthers(TCMessageData data)
           
 boolean sendToBot(cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId bot, cz.cuni.amis.utils.token.IToken messageType, Serializable data)
           
 boolean sendToBot(cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId bot, TCMessageData data)
           
 boolean sendToChannel(int channelId, cz.cuni.amis.utils.token.IToken messageType, Serializable data)
           
 boolean sendToChannel(int channelId, TCMessageData data)
           
 boolean sendToChannelOthers(int channelId, cz.cuni.amis.utils.token.IToken messageType, Serializable data)
           
 boolean sendToChannelOthers(int channelId, TCMessageData data)
           
 boolean sendToTeam(cz.cuni.amis.utils.token.IToken messageType, Serializable data)
           
 boolean sendToTeam(TCMessageData data)
           
 boolean sendToTeamOthers(cz.cuni.amis.utils.token.IToken messageType, Serializable data)
           
 boolean sendToTeamOthers(TCMessageData data)
           
protected  void tcControlServerAlive(TCControlServerAlive event)
           
protected  void tcMessage(TCMessage event)
           
 
Methods inherited from class cz.cuni.amis.pogamut.base.agent.module.AgentModule
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

UT2004TCClient

public UT2004TCClient(UT2004Bot bot,
                      cz.cuni.amis.pogamut.base.communication.worldview.IWorldView teamWorldView)
Method Detail

isConnected

public boolean isConnected()
Whether your bot is connected to the TC server.

Returns:

getConnectedFlag

public cz.cuni.amis.utils.flag.Flag<Boolean> getConnectedFlag()

isConnected

public boolean isConnected(cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId botId)

isConnected

public boolean isConnected(Player bot)

isConnectedToMyTeam

public boolean isConnectedToMyTeam(cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId botId)

isConnectedToMyTeam

public boolean isConnectedToMyTeam(Player bot)

isConnectedToChannel

public boolean isConnectedToChannel(cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId botId,
                                    int channelId)

isConnectedToChannel

public boolean isConnectedToChannel(Player bot,
                                    int channelId)

isChannelExist

public boolean isChannelExist(int channelId)

getConnectedAllBots

public Set<cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId> getConnectedAllBots()
Returns set of all bots connected to the same TC server.

Returns:
READ-ONLY!

getConnectedTeamBots

public Set<cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId> getConnectedTeamBots()
Returns set of bots of the same team connected to the same TC server.

Returns:
READ-ONLY!

getConnectedChannelBots

public Set<cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId> getConnectedChannelBots(int channelId)
Returns set of bots connected to the channel of 'channelId' of the same TC server.

Returns:
READ-ONLY!

getTeam

public TCTeam getTeam()
Returns details about bots/channels connected to the team. Returns NULL if not connected!

Returns:
READ-ONLY!

getChannel

public TCChannel getChannel(int channelId)
Returns details about bots/channels connected to the team. Returns NULL if not connected or non-existing channel!

Returns:
READ-ONLY!

requestCreateChannel

public TCMinaClient.RequestFuture<TCInfoTeamChannelCreated> requestCreateChannel()
Request to create a new channel, the channel will gets channelId assigned by TCMinaServer. When created, you will be automatically added to it as its creator.

Returns:

requestDestroyChannel

public TCMinaClient.RequestFuture<TCInfoTeamChannelDestroyed> requestDestroyChannel(int channelId)
Request to destroy an existing channel. Note that you must be channel's creator in able to do this!

Parameters:
channelId -
Returns:

requestGetStatus

public TCMinaClient.RequestFuture<TCInfoStatus> requestGetStatus()
Request TCInfoStatus update from TCMinaServer.

Returns:
request future or NULL if not connected

requestJoinChannel

public TCMinaClient.RequestFuture<TCInfoTeamChannelBotJoined> requestJoinChannel(int channelId)
Request to join an existing channel.

Parameters:
channelId -
Returns:

requestLeaveChannel

public TCMinaClient.RequestFuture<TCInfoTeamChannelBotLeft> requestLeaveChannel(int channelId)
Request to leave an existing channel. Leaving a channel you have created will NOT destroy it.

Parameters:
channelId -
Returns:

sendToAll

public boolean sendToAll(cz.cuni.amis.utils.token.IToken messageType,
                         Serializable data)

sendToAll

public boolean sendToAll(TCMessageData data)

sendToTeam

public boolean sendToTeam(cz.cuni.amis.utils.token.IToken messageType,
                          Serializable data)

sendToTeam

public boolean sendToTeam(TCMessageData data)

sendToChannel

public boolean sendToChannel(int channelId,
                             cz.cuni.amis.utils.token.IToken messageType,
                             Serializable data)

sendToChannel

public boolean sendToChannel(int channelId,
                             TCMessageData data)

sendToBot

public boolean sendToBot(cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId bot,
                         cz.cuni.amis.utils.token.IToken messageType,
                         Serializable data)

sendToBot

public boolean sendToBot(cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId bot,
                         TCMessageData data)

sendToAllOthers

public boolean sendToAllOthers(cz.cuni.amis.utils.token.IToken messageType,
                               Serializable data)

sendToAllOthers

public boolean sendToAllOthers(TCMessageData data)

sendToTeamOthers

public boolean sendToTeamOthers(cz.cuni.amis.utils.token.IToken messageType,
                                Serializable data)

sendToTeamOthers

public boolean sendToTeamOthers(TCMessageData data)

sendToChannelOthers

public boolean sendToChannelOthers(int channelId,
                                   cz.cuni.amis.utils.token.IToken messageType,
                                   Serializable data)

sendToChannelOthers

public boolean sendToChannelOthers(int channelId,
                                   TCMessageData data)

getMessages

public List<TCMessage> getMessages()
TCMessages that came since the last EndMessage, i.e., since the last update, i.e., since the last logic() iteration.

This list is auto-emptied every EndMessage.

Returns:

getBotId

public cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId getBotId()

getBotTeam

public int getBotTeam()

getSimTime

public long getSimTime()

selfUpdate

protected void selfUpdate(cz.cuni.amis.pogamut.base.communication.worldview.object.event.WorldObjectUpdatedEvent<Self> event)

beginMessage

protected void beginMessage(BeginMessage event)

endMessage

protected void endMessage(EndMessage event)

tcControlServerAlive

protected void tcControlServerAlive(TCControlServerAlive event)

tcMessage

protected void tcMessage(TCMessage event)

cleanUp

protected void cleanUp()
Overrides:
cleanUp in class cz.cuni.amis.pogamut.base.agent.module.AgentModule<UT2004Bot>


Copyright © 2015 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.