3 /** @file ai_tilelist.hpp a simple tilelist which you can manipulate */ |
3 /** @file ai_tilelist.hpp a simple tilelist which you can manipulate */ |
4 |
4 |
5 #ifndef AI_TILELIST_HPP |
5 #ifndef AI_TILELIST_HPP |
6 #define AI_TILELIST_HPP |
6 #define AI_TILELIST_HPP |
7 |
7 |
8 #include "ai_list.hpp" |
8 #include "ai_abstractlist.hpp" |
9 |
9 |
10 /** |
10 /** |
11 * Class that creates a simple list of tiles which you can manipulate. |
11 * Class that creates a simple list of tiles which you can manipulate. |
12 */ |
12 */ |
13 class AITileList : public AIList { |
13 class AITileList : public AIAbstractList { |
14 public: |
14 public: |
15 /** |
15 /** |
16 * The name of the class, needed by several sub-processes. |
16 * The name of the class, needed by several sub-processes. |
17 */ |
17 */ |
18 static const char *GetClassName() { return "AITileList"; } |
18 static const char *GetClassName() { return "AITileList"; } |
65 template <> AITileList *GetParam(ForceType<AITileList *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AITileList *)instance; } |
65 template <> AITileList *GetParam(ForceType<AITileList *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AITileList *)instance; } |
66 }; // namespace SQConvert |
66 }; // namespace SQConvert |
67 |
67 |
68 void SQAITileListRegister(Squirrel *engine) { |
68 void SQAITileListRegister(Squirrel *engine) { |
69 DefSQClass <AITileList> SQAITileList("AITileList"); |
69 DefSQClass <AITileList> SQAITileList("AITileList"); |
70 SQAITileList.PreRegister(engine, "AIList"); |
70 SQAITileList.PreRegister(engine, "AIAbstractList"); |
71 SQAITileList.AddConstructor(engine); |
71 SQAITileList.AddConstructor(engine); |
72 |
72 |
73 SQAITileList.DefSQStaticMethod(engine, &AITileList::GetClassName, "GetClassName", 1, "x"); |
73 SQAITileList.DefSQStaticMethod(engine, &AITileList::GetClassName, "GetClassName", 1, "x"); |
74 |
74 |
75 SQAITileList.DefSQMethod(engine, &AITileList::AddRectangle, "AddRectangle", 3, "xii"); |
75 SQAITileList.DefSQMethod(engine, &AITileList::AddRectangle, "AddRectangle", 3, "xii"); |