src/ai/squirrel/squirrel.hpp
branchnoai
changeset 9422 33efcc5f1b09
parent 9411 29c9dfcdb8e9
child 9426 b90c0d1a36b7
equal deleted inserted replaced
9421:c132ce47f560 9422:33efcc5f1b09
     1 /* $Id$ */
     1 /* $Id$ */
     2 
     2 
     3 /** @file squirrel.hpp declarations of the class for squirrel loader */
     3 /** @file squirrel.hpp declarations of the class for squirrel loader */
     4 
     4 
     5 #ifndef SQUIRREL_HPP
     5 #ifndef AI_SQUIRREL_HPP
     6 #define SQUIRREL_HPP
     6 #define AI_SQUIRREL_HPP
     7 
     7 
     8 #ifdef _UNICODE
     8 #ifdef _UNICODE
     9 /* Disable unicode for squirrel to allow compilation with MINGW
     9 /* Disable unicode for squirrel to allow compilation with MINGW
    10  * and simplify coding for WIN32 (squirrel headers miss a lot of "string" functions)
    10  * and simplify coding for WIN32 (squirrel headers miss a lot of "string" functions)
    11  */
    11  */
    12 #undef _UNICODE
    12 #undef _UNICODE
    13 #endif
    13 #endif
    14 #include <squirrel.h>
    14 #include <squirrel.h>
    15 #include "../core/ai_controller.hpp"
    15 #include "../core/ai_controller.hpp"
    16 #include "../core/ai_factory.hpp"
    16 #include "../core/ai_factory.hpp"
    17 #include "engine.hpp"
    17 #include "../../squirrel.hpp"
    18 
    18 
    19 class AIControllerSquirrel: public AIController {
    19 class AIControllerSquirrel: public AIController {
    20 private:
    20 private:
    21 	SquirrelEngine *engine; ///< The SquirrelEngine
    21 	Squirrel *engine; ///< The Squirrel engine
    22 	HSQOBJECT SQ_instance;  ///< The internal instance of squirrel
    22 	HSQOBJECT SQ_instance;  ///< The internal instance of squirrel
    23 
    23 
    24 	/**
    24 	/**
    25 	 * Registers all our classes, so it can be used from Squirrel.
    25 	 * Registers all our classes, so it can be used from Squirrel.
    26 	 */
    26 	 */
    35 	uint GetTick() { return AIController::GetTick(); }
    35 	uint GetTick() { return AIController::GetTick(); }
    36 };
    36 };
    37 
    37 
    38 class FSquirrel: public AIFactory<FSquirrel> {
    38 class FSquirrel: public AIFactory<FSquirrel> {
    39 private:
    39 private:
    40 	SquirrelEngine *engine; ///< The SquirrelEngine
    40 	Squirrel *engine; ///< The Squirrel engine
    41 	const char *current_script; ///< Temporary variable to know which script defines which class
    41 	const char *current_script; ///< Temporary variable to know which script defines which class
    42 
    42 
    43 	/**
    43 	/**
    44 	 * The constructor for when a script makes an instance of the Factory class.
    44 	 * The constructor for when a script makes an instance of the Factory class.
    45 	 */
    45 	 */
    62 	/* virtual */ AIController *CreateInstance() { return NULL; }
    62 	/* virtual */ AIController *CreateInstance() { return NULL; }
    63 	/* virtual */ bool          AllowStartup()   { return false; }
    63 	/* virtual */ bool          AllowStartup()   { return false; }
    64 	/* virtual */ void          Initializer();
    64 	/* virtual */ void          Initializer();
    65 };
    65 };
    66 
    66 
    67 #endif /* SQUIRREL_HPP */
    67 #endif /* AI_SQUIRREL_HPP */