1
0
Fork 0

(svn r20285) -Codechange: use ///< for single-line doxygen comments in the AI code

release/1.1
yexo 2010-08-01 19:36:56 +00:00
parent 99cb47a382
commit 613b273f36
6 changed files with 61 additions and 61 deletions

View File

@ -145,8 +145,8 @@ public:
static bool HasAI(const struct ContentInfo *ci, bool md5sum); static bool HasAI(const struct ContentInfo *ci, bool md5sum);
#endif #endif
private: private:
static uint frame_counter; //!< Tick counter for the AI code static uint frame_counter; ///< Tick counter for the AI code
static class AIScanner *ai_scanner; //!< AIScanner instance that is used to find AIs static class AIScanner *ai_scanner; ///< AIScanner instance that is used to find AIs
}; };
#else /* ENABLE_AI */ #else /* ENABLE_AI */

View File

@ -144,12 +144,12 @@ public:
void SettingsToString(char *string, size_t size) const; void SettingsToString(char *string, size_t size) const;
private: private:
const char *name; //!< Name of the AI const char *name; ///< Name of the AI
int version; //!< Version of the AI int version; ///< Version of the AI
class AIInfo *info; //!< AIInfo object for related to this AI version class AIInfo *info; ///< AIInfo object for related to this AI version
SettingValueList settings; //!< List with all setting=>value pairs that are configure for this AI SettingValueList settings; ///< List with all setting=>value pairs that are configure for this AI
AIConfigItemList *config_list; //!< List with all settings defined by this AI AIConfigItemList *config_list; ///< List with all settings defined by this AI
bool is_random_ai; //!< True if the AI in this slot was randomly chosen. bool is_random_ai; ///< True if the AI in this slot was randomly chosen.
}; };
#endif /* ENABLE_AI */ #endif /* ENABLE_AI */

View File

@ -20,33 +20,33 @@
/** Bitmask of flags for AI settings. */ /** Bitmask of flags for AI settings. */
enum AIConfigFlags { enum AIConfigFlags {
AICONFIG_NONE = 0x0, //!< No flags set. AICONFIG_NONE = 0x0, ///< No flags set.
AICONFIG_RANDOM = 0x1, //!< When randomizing the AI, pick any value between min_value and max_value when on custom difficulty setting. AICONFIG_RANDOM = 0x1, ///< When randomizing the AI, pick any value between min_value and max_value when on custom difficulty setting.
AICONFIG_BOOLEAN = 0x2, //!< This value is a boolean (either 0 (false) or 1 (true) ). AICONFIG_BOOLEAN = 0x2, ///< This value is a boolean (either 0 (false) or 1 (true) ).
AICONFIG_INGAME = 0x4, //!< This setting can be changed while the AI is running. AICONFIG_INGAME = 0x4, ///< This setting can be changed while the AI is running.
}; };
typedef SmallMap<int, char *> LabelMapping; //!< Map-type used to map the setting numbers to labels. typedef SmallMap<int, char *> LabelMapping; ///< Map-type used to map the setting numbers to labels.
/** Info about a single AI setting. */ /** Info about a single AI setting. */
struct AIConfigItem { struct AIConfigItem {
const char *name; //!< The name of the configuration setting. const char *name; ///< The name of the configuration setting.
const char *description; //!< The description of the configuration setting. const char *description; ///< The description of the configuration setting.
int min_value; //!< The minimal value this configuration setting can have. int min_value; ///< The minimal value this configuration setting can have.
int max_value; //!< The maximal value this configuration setting can have. int max_value; ///< The maximal value this configuration setting can have.
int custom_value; //!< The default value on custom difficulty setting. int custom_value; ///< The default value on custom difficulty setting.
int easy_value; //!< The default value on easy difficulty setting. int easy_value; ///< The default value on easy difficulty setting.
int medium_value; //!< The default value on medium difficulty setting. int medium_value; ///< The default value on medium difficulty setting.
int hard_value; //!< The default value on hard difficulty setting. int hard_value; ///< The default value on hard difficulty setting.
int random_deviation; //!< The maximum random deviation from the default value. int random_deviation; ///< The maximum random deviation from the default value.
int step_size; //!< The step size in the gui. int step_size; ///< The step size in the gui.
AIConfigFlags flags; //!< Flags for the configuration setting. AIConfigFlags flags; ///< Flags for the configuration setting.
LabelMapping *labels; //!< Text labels for the integer values. LabelMapping *labels; ///< Text labels for the integer values.
}; };
extern AIConfigItem _start_date_config; extern AIConfigItem _start_date_config;
typedef std::list<AIConfigItem> AIConfigItemList; //!< List of AIConfig items. typedef std::list<AIConfigItem> AIConfigItemList; ///< List of AIConfig items.
/** Base class that holds some basic information about AIs and AI libraries. */ /** Base class that holds some basic information about AIs and AI libraries. */
class AIFileInfo : public ScriptFileInfo { class AIFileInfo : public ScriptFileInfo {
@ -57,7 +57,7 @@ public:
static SQInteger Constructor(HSQUIRRELVM vm, AIFileInfo *info); static SQInteger Constructor(HSQUIRRELVM vm, AIFileInfo *info);
protected: protected:
class AIScanner *base; //!< AIScanner object that was used to scan this AI (library) info. class AIScanner *base; ///< AIScanner object that was used to scan this AI (library) info.
}; };
/** All static information from an AI like name, version, etc. */ /** All static information from an AI like name, version, etc. */
@ -124,10 +124,10 @@ public:
const char *GetAPIVersion() const { return this->api_version; } const char *GetAPIVersion() const { return this->api_version; }
private: private:
AIConfigItemList config_list; //!< List of settings from this AI. AIConfigItemList config_list; ///< List of settings from this AI.
int min_loadable_version; //!< The AI can load savegame data if the version is equal or greater than this. int min_loadable_version; ///< The AI can load savegame data if the version is equal or greater than this.
bool use_as_random; //!< Should this AI be used when the user wants a "random AI"? bool use_as_random; ///< Should this AI be used when the user wants a "random AI"?
const char *api_version; //!< API version used by this AI. const char *api_version; ///< API version used by this AI.
}; };
/** All static information from an AI library like name, version, etc. */ /** All static information from an AI library like name, version, etc. */
@ -154,7 +154,7 @@ public:
const char *GetCategory() const { return this->category; } const char *GetCategory() const { return this->category; }
private: private:
const char *category; //!< The category this library is in. const char *category; ///< The category this library is in.
}; };
#endif /* ENABLE_AI */ #endif /* ENABLE_AI */

View File

@ -458,7 +458,7 @@ enum SQSaveLoadType {
SQSL_ARRAY_TABLE_END = 0xFF, ///< Marks the end of an array or table, no data follows. SQSL_ARRAY_TABLE_END = 0xFF, ///< Marks the end of an array or table, no data follows.
}; };
static byte _ai_sl_byte; //!< Used as source/target by the AI saveload code to store/load a single byte. static byte _ai_sl_byte; ///< Used as source/target by the AI saveload code to store/load a single byte.
/** SaveLoad array that saves/loads exactly one byte. */ /** SaveLoad array that saves/loads exactly one byte. */
static const SaveLoad _ai_byte[] = { static const SaveLoad _ai_byte[] = {

View File

@ -42,8 +42,8 @@ public:
AISuspendCallbackProc *GetSuspendCallback() { return callback; } AISuspendCallbackProc *GetSuspendCallback() { return callback; }
private: private:
int time; //!< Amount of ticks to suspend the AI. int time; ///< Amount of ticks to suspend the AI.
AISuspendCallbackProc *callback; //!< Callback function to call when the AI can run again. AISuspendCallbackProc *callback; ///< Callback function to call when the AI can run again.
}; };
/** /**
@ -155,16 +155,16 @@ public:
*/ */
void Suspend(); void Suspend();
private: private:
class AIController *controller; //!< The AI main class. class AIController *controller; ///< The AI main class.
class AIStorage *storage; //!< Some global information for each running AI. class AIStorage *storage; ///< Some global information for each running AI.
class Squirrel *engine; //!< A wrapper around the squirrel vm. class Squirrel *engine; ///< A wrapper around the squirrel vm.
SQObject *instance; //!< Squirrel-pointer to the AI main class. SQObject *instance; ///< Squirrel-pointer to the AI main class.
bool is_started; //!< Is the AIs constructor executed? bool is_started; ///< Is the AIs constructor executed?
bool is_dead; //!< True if the AI has been stopped. bool is_dead; ///< True if the AI has been stopped.
bool is_save_data_on_stack; //!< Is the save data still on the squirrel stack? bool is_save_data_on_stack; ///< Is the save data still on the squirrel stack?
int suspend; //!< The amount of ticks to suspend this AI before it's allowed to continue. int suspend; ///< The amount of ticks to suspend this AI before it's allowed to continue.
AISuspendCallbackProc *callback; //!< Callback that should be called in the next tick the AI runs. AISuspendCallbackProc *callback; ///< Callback that should be called in the next tick the AI runs.
/** /**
* Register all API functions to the VM. * Register all API functions to the VM.

View File

@ -36,29 +36,29 @@ typedef bool (AIModeProc)();
class AIStorage { class AIStorage {
friend class AIObject; friend class AIObject;
private: private:
AIModeProc *mode; //!< The current build mode we are int. AIModeProc *mode; ///< The current build mode we are int.
class AIObject *mode_instance; //!< The instance belonging to the current build mode. class AIObject *mode_instance; ///< The instance belonging to the current build mode.
uint delay; //!< The ticks of delay each DoCommand has. uint delay; ///< The ticks of delay each DoCommand has.
bool allow_do_command; //!< Is the usage of DoCommands restricted? bool allow_do_command; ///< Is the usage of DoCommands restricted?
CommandCost costs; //!< The costs the AI is tracking. CommandCost costs; ///< The costs the AI is tracking.
Money last_cost; //!< The last cost of the command. Money last_cost; ///< The last cost of the command.
uint last_error; //!< The last error of the command. uint last_error; ///< The last error of the command.
bool last_command_res; //!< The last result of the command. bool last_command_res; ///< The last result of the command.
VehicleID new_vehicle_id; //!< The ID of the new Vehicle. VehicleID new_vehicle_id; ///< The ID of the new Vehicle.
SignID new_sign_id; //!< The ID of the new Sign. SignID new_sign_id; ///< The ID of the new Sign.
TileIndex new_tunnel_endtile; //!< The TileIndex of the new Tunnel. TileIndex new_tunnel_endtile; ///< The TileIndex of the new Tunnel.
GroupID new_group_id; //!< The ID of the new Group. GroupID new_group_id; ///< The ID of the new Group.
std::vector<int> callback_value; //!< The values which need to survive a callback. std::vector<int> callback_value; ///< The values which need to survive a callback.
RoadType road_type; //!< The current roadtype we build. RoadType road_type; ///< The current roadtype we build.
RailType rail_type; //!< The current railtype we build. RailType rail_type; ///< The current railtype we build.
void *event_data; //!< Pointer to the event data storage. void *event_data; ///< Pointer to the event data storage.
void *log_data; //!< Pointer to the log data storage. void *log_data; ///< Pointer to the log data storage.
public: public:
AIStorage() : AIStorage() :