File diff r18500:14a481bc4437 → r18501:8e3d905ea4bc
src/ai/ai_instance.hpp
Show inline comments
 
@@ -74,14 +74,14 @@ private:
 
	const char *msg; ///< The error message.
 
};
 

	
 
/** Runtime information about an AI like a pointer to the squirrel vm and the current state. */
 
class AIInstance {
 
public:
 
	friend class AIObject;
 
	friend class AIController;
 
	friend class ScriptObject;
 
	friend class ScriptController;
 

	
 
	/**
 
	 * Create a new AI.
 
	 */
 
	AIInstance();
 
	~AIInstance();
 
@@ -138,13 +138,13 @@ public:
 
	 */
 
	static void DoCommandReturnGroupID(AIInstance *instance);
 

	
 
	/**
 
	 * Get the controller attached to the instance.
 
	 */
 
	class AIController *GetController() { return controller; }
 
	class ScriptController *GetController() { return controller; }
 

	
 
	/**
 
	 * Return the "this AI died" value
 
	 */
 
	inline bool IsDead() const { return this->is_dead; }
 

	
 
@@ -195,16 +195,16 @@ public:
 
	void DoCommandCallback(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2);
 

	
 
	/**
 
	 * Insert an event for this AI.
 
	 * @param event The event to insert.
 
	 */
 
	void InsertEvent(class AIEvent *event);
 
	void InsertEvent(class ScriptEvent *event);
 

	
 
private:
 
	class AIController *controller;  ///< The AI main class.
 
	class ScriptController *controller; ///< The AI main class.
 
	class AIStorage *storage;        ///< Some global information for each running AI.
 
	class Squirrel *engine;          ///< A wrapper around the squirrel vm.
 
	SQObject *instance;              ///< Squirrel-pointer to the AI main class.
 

	
 
	bool is_started;                 ///< Is the AIs constructor executed?
 
	bool is_dead;                    ///< True if the AI has been stopped.