Public Member Functions | Protected Member Functions | Private Attributes

AIScannerInfo Class Reference

Inheritance diagram for AIScannerInfo:
ScriptScanner FileScanner

Public Member Functions

void Initialize ()
class AIInfoSelectRandomAI () const
 Select a random AI.
class AIInfoFindInfo (const char *nameParam, int versionParam, bool force_exact_match)
 Check if we have an AI by name and version available in our list.
void SetDummyAI (class AIInfo *info)
 Set the Dummy AI.

Protected Member Functions

void GetScriptName (ScriptInfo *info, char *name, int len)
 Get the script name how to store the script in memory.
const char * GetFileName () const
 Get the filename to scan for this type of script.
Subdirectory GetDirectory () const
 Get the directory to scan in.
const char * GetScannerName () const
 Get the type of the script, in plural.
void RegisterAPI (class Squirrel *engine)
 Register the API for this ScriptInfo.

Private Attributes

AIInfoinfo_dummy
 The dummy AI.

Detailed Description

Definition at line 17 of file ai_scanner.hpp.


Member Function Documentation

AIInfo * AIScannerInfo::FindInfo ( const char *  nameParam,
int  versionParam,
bool  force_exact_match 
)

Check if we have an AI by name and version available in our list.

Parameters:
nameParam The name of the AI.
versionParam The version of the AI, or -1 if you want the latest.
force_exact_match Only match name+version, never latest.
Returns:
NULL if no match found, otherwise the AI that matched.

Definition at line 93 of file ai_scanner.cpp.

References AIInfo::CanLoadFromVersion(), ScriptInfo::GetName(), ScriptInfo::GetVersion(), ScriptScanner::info_list, ScriptScanner::info_single_list, strtolower(), and ttd_strlcpy().

Referenced by AI::FindInfo().

AIInfo * AIScannerInfo::SelectRandomAI (  )  const

Select a random AI.

Returns:
A random AI from the pool.

Definition at line 59 of file ai_scanner.cpp.

References _networking, DEBUG, info_dummy, ScriptScanner::info_single_list, RandomRange(), and AIInfo::UseAsRandomAI().

Referenced by AI::StartNew().


The documentation for this class was generated from the following files: