src/ai/NoAI/NoAI.hpp
author rubidium
Fri, 16 Mar 2007 22:00:07 +0000
branchnoai
changeset 9444 fd27df7ca2a0
parent 9441 03da911c8d5f
child 9449 8b688e6517d0
permissions -rw-r--r--
(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 */