(svn r21703) -Feature [FS#4372]: list_ai_libs console command to get a list of recognized AI libraries (dihedral)
This commit is contained in:
@@ -126,6 +126,8 @@ public:
|
||||
|
||||
/** Wrapper function for AIScanner::GetAIConsoleList */
|
||||
static char *GetConsoleList(char *p, const char *last);
|
||||
/** Wrapper function for AIScanner::GetAIConsoleLibraryList */
|
||||
static char *GetConsoleLibraryList(char *p, const char *last);
|
||||
/** Wrapper function for AIScanner::GetAIInfoList */
|
||||
static const AIInfoList *GetInfoList();
|
||||
/** Wrapper function for AIScanner::GetUniqueAIInfoList */
|
||||
|
@@ -294,6 +294,11 @@ void CcAI(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2)
|
||||
return AI::ai_scanner->GetAIConsoleList(p, last);
|
||||
}
|
||||
|
||||
/* static */ char *AI::GetConsoleLibraryList(char *p, const char *last)
|
||||
{
|
||||
return AI::ai_scanner->GetAIConsoleLibraryList(p, last);
|
||||
}
|
||||
|
||||
/* static */ const AIInfoList *AI::GetInfoList()
|
||||
{
|
||||
return AI::ai_scanner->GetAIInfoList();
|
||||
|
@@ -343,6 +343,19 @@ char *AIScanner::GetAIConsoleList(char *p, const char *last) const
|
||||
return p;
|
||||
}
|
||||
|
||||
char *AIScanner::GetAIConsoleLibraryList(char *p, const char *last) const
|
||||
{
|
||||
p += seprintf(p, last, "List of AI Libraries:\n");
|
||||
AILibraryList::const_iterator it = this->library_list.begin();
|
||||
for (; it != this->library_list.end(); it++) {
|
||||
AILibrary *i = (*it).second;
|
||||
p += seprintf(p, last, "%10s (v%d): %s\n", i->GetName(), i->GetVersion(), i->GetDescription());
|
||||
}
|
||||
p += seprintf(p, last, "\n");
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
#if defined(ENABLE_NETWORK)
|
||||
#include "../network/network_content.h"
|
||||
#include "../3rdparty/md5/md5.h"
|
||||
|
@@ -58,6 +58,11 @@ public:
|
||||
*/
|
||||
char *GetAIConsoleList(char *p, const char *last) const;
|
||||
|
||||
/**
|
||||
* Get the list of available AI Libraries for the console.
|
||||
*/
|
||||
char *GetAIConsoleLibraryList(char *p, const char *last) const;
|
||||
|
||||
/**
|
||||
* Get the list of all registered AIs.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user