cz.cuni.amis.pogamut.ut2004.factory.guice.remoteagent
Class UT2004BotModule<PARAMS extends UT2004AgentParameters>

java.lang.Object
  extended by com.google.inject.AbstractModule
      extended by cz.cuni.amis.pogamut.base.factory.guice.GuiceAgentModule<PARAMS>
          extended by cz.cuni.amis.pogamut.base.factory.guice.GuiceCommunicationModule<PARAMS>
              extended by cz.cuni.amis.pogamut.base.factory.guice.GuiceRemoteAgentModule<PARAMS>
                  extended by cz.cuni.amis.pogamut.ut2004.factory.guice.remoteagent.UT2004CommunicationModule<PARAMS>
                      extended by cz.cuni.amis.pogamut.ut2004.factory.guice.remoteagent.UT2004BotModule<PARAMS>
All Implemented Interfaces:
com.google.inject.Module

public class UT2004BotModule<PARAMS extends UT2004AgentParameters>
extends UT2004CommunicationModule<PARAMS>

Module extending UT2004CommunicationModule for the purpose of UT2004Bot instantiation.

Introduces worldViewDependenciesProvider.

Newly binded classes:

Mapped class Target Description
IWorldMessageTranslator -> BotFSM Protocol-validating translator of InfoMessages of GameBots2004.
IWorldView -> IVisionWorldView Binds world view as vision world view.
IVisionWorldView -> ILockableVisionWorldViewBinds vision world view as lockable one.
ILockableWorldView -> ILockableVisionWorldViewBinds lockable world view as vision world view.
ILockableVisionWorldView-> UT2004SyncLockableWorldView Binds world view with concrete implementation.
UT2004SyncLockableWorldView dependencies -> worldViewDependenciesProvider
IAgent -> IAgent3D
IAgent3D -> IUT2004Bot
IUT2004Bot -> UT2004Bot Binds concrete implementation of the agent.
To have successful module the descendant must specify these missing bindings:
Mapped class Description
IUT2004BotController Controller of the bot.
... plus all newly introduced dependencies (by various implementors of mentioned interfaces).

... don't forget to call super.configureModules() in the subclasses ;-)

See Also:
UT2004CommunicationModule, GuiceRemoteAgentModule, GuiceAgentModule

Field Summary
protected  AdaptableProvider<ComponentDependencies> worldViewDependenciesProvider
          Dependency provider for the world view, so the world view know when to start.
 
Fields inherited from class cz.cuni.amis.pogamut.ut2004.factory.guice.remoteagent.UT2004CommunicationModule
connectionDependenciesProvider
 
Constructor Summary
protected UT2004BotModule()
           
  UT2004BotModule(java.lang.Class<? extends IUT2004BotController> botControllerClass)
           
 
Method Summary
protected  void configureModules()
          Override to create new module with your own bindings adding it into GuiceAgentModule.modules using GuiceCommunicationModule#addModule(Module).
 void prepareNewAgent(PARAMS agentParameters)
          Binds runtime dependencies to the module/Injector.
 
Methods inherited from class cz.cuni.amis.pogamut.base.factory.guice.GuiceRemoteAgentModule
getAddressProvider
 
Methods inherited from class cz.cuni.amis.pogamut.base.factory.guice.GuiceAgentModule
addModule, configure, createAgentScope, getAgentIdProvider, getAgentParamsProvider, getAgentScope
 
Methods inherited from class com.google.inject.AbstractModule
addError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, bindListener, bindScope, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestStaticInjection, requireBinding, requireBinding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

worldViewDependenciesProvider

protected AdaptableProvider<ComponentDependencies> worldViewDependenciesProvider
Dependency provider for the world view, so the world view know when to start.

Constructor Detail

UT2004BotModule

protected UT2004BotModule()

UT2004BotModule

public UT2004BotModule(java.lang.Class<? extends IUT2004BotController> botControllerClass)
Method Detail

prepareNewAgent

public void prepareNewAgent(PARAMS agentParameters)
Description copied from class: UT2004CommunicationModule
Binds runtime dependencies to the module/Injector.

Must be called before the new agent is instantiated with Injector.

Overrides:
prepareNewAgent in class UT2004CommunicationModule<PARAMS extends UT2004AgentParameters>

configureModules

protected void configureModules()
Description copied from class: GuiceCommunicationModule
Override to create new module with your own bindings adding it into GuiceAgentModule.modules using GuiceCommunicationModule#addModule(Module).

See GuiceCommunicationModule.configureModules() source code for the example (utilizes anonymous class, instantiating AbstractModule).

Overrides:
configureModules in class UT2004CommunicationModule<PARAMS extends UT2004AgentParameters>