(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
#include "ai_map.hpp"
namespace SQConvert {
/* Allow AIMap to be used as Squirrel parameter */
template <> AIMap *GetParam(ForceType<AIMap *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIMap *)instance; }
template <> AIMap &GetParam(ForceType<AIMap &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIMap *)instance; }
template <> const AIMap *GetParam(ForceType<const AIMap *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIMap *)instance; }
template <> const AIMap &GetParam(ForceType<const AIMap &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIMap *)instance; }
}; // namespace SQConvert
void SQAIMapRegister(Squirrel *engine) {
DefSQClass <AIMap> SQAIMap("AIMap");
SQAIMap.PreRegister(engine);
SQAIMap.AddConstructor(engine);
SQAIMap.DefSQStaticMethod(engine, &AIMap::GetClassName, "GetClassName", 1, "x");
SQAIMap.DefSQMethod(engine, &AIMap::IsValidTile, "IsValidTile", 2, "xi");
SQAIMap.DefSQMethod(engine, &AIMap::GetMapSize, "GetMapSize", 1, "x");
SQAIMap.DefSQMethod(engine, &AIMap::GetMapSizeX, "GetMapSizeX", 1, "x");
SQAIMap.DefSQMethod(engine, &AIMap::GetMapSizeY, "GetMapSizeY", 1, "x");
SQAIMap.DefSQMethod(engine, &AIMap::GetTileX, "GetTileX", 2, "xi");
SQAIMap.DefSQMethod(engine, &AIMap::GetTileY, "GetTileY", 2, "xi");
SQAIMap.DefSQMethod(engine, &AIMap::GetTileIndex, "GetTileIndex", 3, "xii");
SQAIMap.DefSQMethod(engine, &AIMap::DistanceManhattan, "DistanceManhattan", 3, "xii");
SQAIMap.DefSQMethod(engine, &AIMap::DistanceMax, "DistanceMax", 3, "xii");
SQAIMap.DefSQMethod(engine, &AIMap::DistanceSquare, "DistanceSquare", 3, "xii");
SQAIMap.DefSQMethod(engine, &AIMap::DistanceFromEdge, "DistanceFromEdge", 2, "xi");
SQAIMap.DefSQMethod(engine, &AIMap::DemolishTile, "DemolishTile", 2, "xi");
SQAIMap.PostRegister(engine);
}