(svn r23364) -Codechange: refactor AIConfig, moving it mostly to Scriptconfig

This commit is contained in:
truebrain
2011-11-29 23:26:35 +00:00
parent c38c16773c
commit 34d7f01ccc
21 changed files with 815 additions and 643 deletions

View File

@@ -15,6 +15,8 @@
#include <squirrel.h>
#include "../misc/countedptr.hpp"
#include "script_config.hpp"
class ScriptInfo : public SimpleCountedObject {
public:
ScriptInfo() :
@@ -98,9 +100,41 @@ public:
*/
virtual class ScriptScanner *GetScanner() { return this->scanner; }
/**
* Get the settings of the Script.
*/
bool GetSettings();
/**
* Get the config list for this Script.
*/
const ScriptConfigItemList *GetConfigList() const;
/**
* Get the description of a certain Script config option.
*/
const ScriptConfigItem *GetConfigItem(const char *name) const;
/**
* Set a setting.
*/
SQInteger AddSetting(HSQUIRRELVM vm);
/**
* Add labels for a setting.
*/
SQInteger AddLabels(HSQUIRRELVM vm);
/**
* Get the default value for a setting.
*/
int GetSettingDefaultValue(const char *name) const;
protected:
class Squirrel *engine; ///< Engine used to register for Squirrel.
HSQOBJECT *SQ_instance; ///< The Squirrel instance created for this info.
class Squirrel *engine; ///< Engine used to register for Squirrel.
HSQOBJECT *SQ_instance; ///< The Squirrel instance created for this info.
ScriptConfigItemList config_list; ///< List of settings from this Script.
private:
char *main_script; ///< The full path of the script.