summaryrefslogtreecommitdiff
path: root/src/ai/api/ai_waypoint.hpp.sq
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2009-07-31 22:30:54 +0000
committeryexo <yexo@openttd.org>2009-07-31 22:30:54 +0000
commit8c05194c0241d88226ba6c727a0c45b00d8495ed (patch)
treebe76ebd36a14a7828a9ed5400f42045b375b7c50 /src/ai/api/ai_waypoint.hpp.sq
parentb129184d57cac186c53bda3e8165efd63806c2aa (diff)
downloadopenttd-8c05194c0241d88226ba6c727a0c45b00d8495ed.tar.xz
(svn r17011) -Change [NoAI]: Add AIBaseStation as a parentclass for AIStation and AIWaypoint, and move GetName, SetName and GetLocation to AIBaseStation
Remove (nearly) all references to WaypointID and replace them with StationID
Diffstat (limited to 'src/ai/api/ai_waypoint.hpp.sq')
-rw-r--r--src/ai/api/ai_waypoint.hpp.sq11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/ai/api/ai_waypoint.hpp.sq b/src/ai/api/ai_waypoint.hpp.sq
index ef17875ac..fc6e0aa3a 100644
--- a/src/ai/api/ai_waypoint.hpp.sq
+++ b/src/ai/api/ai_waypoint.hpp.sq
@@ -4,10 +4,6 @@
#include "ai_waypoint.hpp"
namespace SQConvert {
- /* Allow enums to be used as Squirrel parameters */
- template <> AIWaypoint::SpecialWaypointIDs GetParam(ForceType<AIWaypoint::SpecialWaypointIDs>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AIWaypoint::SpecialWaypointIDs)tmp; }
- template <> int Return<AIWaypoint::SpecialWaypointIDs>(HSQUIRRELVM vm, AIWaypoint::SpecialWaypointIDs res) { sq_pushinteger(vm, (int32)res); return 1; }
-
/* Allow AIWaypoint to be used as Squirrel parameter */
template <> AIWaypoint *GetParam(ForceType<AIWaypoint *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIWaypoint *)instance; }
template <> AIWaypoint &GetParam(ForceType<AIWaypoint &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIWaypoint *)instance; }
@@ -18,16 +14,11 @@ namespace SQConvert {
void SQAIWaypoint_Register(Squirrel *engine) {
DefSQClass <AIWaypoint> SQAIWaypoint("AIWaypoint");
- SQAIWaypoint.PreRegister(engine);
+ SQAIWaypoint.PreRegister(engine, "AIBaseStation");
SQAIWaypoint.AddConstructor<void (AIWaypoint::*)(), 1>(engine, "x");
- SQAIWaypoint.DefSQConst(engine, AIWaypoint::WAYPOINT_INVALID, "WAYPOINT_INVALID");
-
SQAIWaypoint.DefSQStaticMethod(engine, &AIWaypoint::IsValidWaypoint, "IsValidWaypoint", 2, ".i");
SQAIWaypoint.DefSQStaticMethod(engine, &AIWaypoint::GetWaypointID, "GetWaypointID", 2, ".i");
- SQAIWaypoint.DefSQStaticMethod(engine, &AIWaypoint::GetName, "GetName", 2, ".i");
- SQAIWaypoint.DefSQStaticMethod(engine, &AIWaypoint::SetName, "SetName", 3, ".is");
- SQAIWaypoint.DefSQStaticMethod(engine, &AIWaypoint::GetLocation, "GetLocation", 2, ".i");
SQAIWaypoint.PostRegister(engine);
}