(svn r9260) [NoAI] -Codechange: do the AI threading properly using a mutex and condition signalling.
Note: this is pthread specific code, it needs to be ported to non POSIX platform.
/* $Id$ */
/** @file NoAI.hpp declarations of the class for a simple C++ AI that will never be an AI */
#ifndef NOAI_HPP
#define NOAI_HPP
#include "../ai_factory.hpp"
#include "../api/ai_controller.hpp"
#include "../api/ai_base.hpp"
#include "../api/ai_cargo.hpp"
#include "../api/ai_company.hpp"
#include "../api/ai_industry.hpp"
#include "../api/ai_map.hpp"
#include "../api/ai_town.hpp"
class NoAI: public AIController {
private:
AIBase base;
AICargo cargo;
AICompany company;
AIIndustry industry;
AIMap map;
AITown town;
bool stop;
public:
/* virtual */ void Start();
/* virtual */ void Stop();
};
class FNoAI: public AIFactory<FNoAI> {
public:
/* virtual */ const char *GetAuthor() { return "OpenTTD Dev Team"; }
/* virtual */ const char *GetName() { return "NoAI"; }
/* virtual */ const char *GetDescription() { return "Rather simple AI that tests all the functions of the AI layer."; }
/* virtual */ int GetVersion() { return 1; }
/* virtual */ const char *GetDate() { return "2007-03-14"; }
/* virtual */ AIController *CreateInstance() { return new NoAI(); }
};
#endif /* NOAI_HPP */