cz.cuni.amis.pogamut.ut2004.bot.sposh
Class FileScriptLogic

Package class diagram package FileScriptLogic
java.lang.Object
  extended by cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotController<BOT>
      extended by cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotLogicController
          extended by cz.cuni.amis.pogamut.ut2004.bot.sposh.StreamScriptLogic
              extended by cz.cuni.amis.pogamut.ut2004.bot.sposh.FileScriptLogic
All Implemented Interfaces:
cz.cuni.amis.pogamut.base.agent.module.IAgentLogic, IUT2004BotController, IUT2004BotLogicController

Deprecated.

@Deprecated
public abstract class FileScriptLogic
extends StreamScriptLogic

This class is base class for users who program their agents in some scripting language and have thir file ready to use. Override FileScriptedAgent.getScriptFile() to specify the script that will be loaded.

To subclass this class, override getScriptFile(), doLogic() and other necessary methods. Use callFunction method to call scripted function from specified script.

Author:
Honza

Field Summary
 
Fields inherited from class cz.cuni.amis.pogamut.ut2004.bot.sposh.StreamScriptLogic
engine, invocableEngine, scriptEngineManager
 
Fields inherited from class cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotLogicController
logicModule
 
Fields inherited from class cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotController
bot, log, USER_LOG_CATEGORY_ID
 
Constructor Summary
FileScriptLogic()
          Deprecated.  
 
Method Summary
protected  ScriptEngine createScriptEngine(ScriptEngineManager manager)
          Deprecated. Create a ScriptEngine according to extension of script specified in getScriptFile()
protected  String getExt(String path)
          Deprecated. Get extension of
protected abstract  String getScriptFile()
          Deprecated. Return path to the script file.
protected  Reader getScriptStream()
          Deprecated. Get stream of file from script file specified in FileScriptedAgent.getScriptFile().
 
Methods inherited from class cz.cuni.amis.pogamut.ut2004.bot.sposh.StreamScriptLogic
callFunction, engineBinded, evalStream, getBot, initializeController, scriptBinded, setAttribute
 
Methods inherited from class cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotLogicController
beforeFirstLogic, getLogicInitializeTime, getLogicShutdownTime, initializeLogic, logic, logicInitialize, logicShutdown
 
Methods inherited from class cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotController
botFirstSpawn, botInitialized, botKilled, botShutdown, finishControllerInitialization, getAct, getInitializeCommand, getLog, getPassword, getWorldView, prepareBot
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface cz.cuni.amis.pogamut.ut2004.bot.IUT2004BotController
botFirstSpawn, botInitialized, botKilled, botShutdown, finishControllerInitialization, getAct, getInitializeCommand, getLog, getPassword, getWorldView, prepareBot
 

Constructor Detail

FileScriptLogic

public FileScriptLogic()
Deprecated. 
Method Detail

createScriptEngine

protected ScriptEngine createScriptEngine(ScriptEngineManager manager)
Deprecated. 
Create a ScriptEngine according to extension of script specified in getScriptFile()

Specified by:
createScriptEngine in class StreamScriptLogic
Parameters:
manager -
Returns:
Correct script engine for script file.

getScriptStream

protected Reader getScriptStream()
                          throws IOException
Deprecated. 
Get stream of file from script file specified in FileScriptedAgent.getScriptFile().

Specified by:
getScriptStream in class StreamScriptLogic
Returns:
Throws:
IOException - If some problem occurs with getting stream from script file.

getScriptFile

protected abstract String getScriptFile()
Deprecated. 
Return path to the script file. Absolute path if possible, because I am not sure about relative path. TODO: some reliable way to get root directroy of project

Returns:
Return path

getExt

protected String getExt(String path)
Deprecated. 
Get extension of

Parameters:
path -
Returns:
extension or "" if no extension found


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