From 091d88f5143601a456c3688ff9305f144a5ed6e2 Mon Sep 17 00:00:00 2001 From: yexo Date: Thu, 4 Feb 2010 23:18:19 +0000 Subject: (svn r19014) -Add: [NoAI] AIOrder::[G|S]etStopLocation to get/set the stop location of trains in a rail station --- src/ai/api/ai_order.hpp.sq | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/ai/api/ai_order.hpp.sq') diff --git a/src/ai/api/ai_order.hpp.sq b/src/ai/api/ai_order.hpp.sq index 53fa61e4e..c6aa1c873 100644 --- a/src/ai/api/ai_order.hpp.sq +++ b/src/ai/api/ai_order.hpp.sq @@ -23,6 +23,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIOrder::CompareFunction res) { sq_pushinteger(vm, (int32)res); return 1; } template <> AIOrder::OrderPosition GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AIOrder::OrderPosition)tmp; } template <> int Return(HSQUIRRELVM vm, AIOrder::OrderPosition res) { sq_pushinteger(vm, (int32)res); return 1; } + template <> AIOrder::StopLocation GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AIOrder::StopLocation)tmp; } + template <> int Return(HSQUIRRELVM vm, AIOrder::StopLocation res) { sq_pushinteger(vm, (int32)res); return 1; } /* Allow AIOrder to be used as Squirrel parameter */ template <> AIOrder *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIOrder *)instance; } @@ -76,6 +78,10 @@ void SQAIOrder_Register(Squirrel *engine) SQAIOrder.DefSQConst(engine, AIOrder::CF_INVALID, "CF_INVALID"); SQAIOrder.DefSQConst(engine, AIOrder::ORDER_CURRENT, "ORDER_CURRENT"); SQAIOrder.DefSQConst(engine, AIOrder::ORDER_INVALID, "ORDER_INVALID"); + SQAIOrder.DefSQConst(engine, AIOrder::STOPLOCATION_NEAR, "STOPLOCATION_NEAR"); + SQAIOrder.DefSQConst(engine, AIOrder::STOPLOCATION_MIDDLE, "STOPLOCATION_MIDDLE"); + SQAIOrder.DefSQConst(engine, AIOrder::STOPLOCATION_FAR, "STOPLOCATION_FAR"); + SQAIOrder.DefSQConst(engine, AIOrder::STOPLOCATION_INVALID, "STOPLOCATION_INVALID"); AIError::RegisterErrorMap(STR_ERROR_NO_MORE_SPACE_FOR_ORDERS, AIOrder::ERR_ORDER_TOO_MANY); AIError::RegisterErrorMap(STR_ERROR_TOO_FAR_FROM_PREVIOUS_DESTINATION, AIOrder::ERR_ORDER_TOO_FAR_AWAY_FROM_PREVIOUS_DESTINATION); @@ -99,10 +105,12 @@ void SQAIOrder_Register(Squirrel *engine) SQAIOrder.DefSQStaticMethod(engine, &AIOrder::GetOrderCondition, "GetOrderCondition", 3, ".ii"); SQAIOrder.DefSQStaticMethod(engine, &AIOrder::GetOrderCompareFunction, "GetOrderCompareFunction", 3, ".ii"); SQAIOrder.DefSQStaticMethod(engine, &AIOrder::GetOrderCompareValue, "GetOrderCompareValue", 3, ".ii"); + SQAIOrder.DefSQStaticMethod(engine, &AIOrder::GetStopLocation, "GetStopLocation", 3, ".ii"); SQAIOrder.DefSQStaticMethod(engine, &AIOrder::SetOrderJumpTo, "SetOrderJumpTo", 4, ".iii"); SQAIOrder.DefSQStaticMethod(engine, &AIOrder::SetOrderCondition, "SetOrderCondition", 4, ".iii"); SQAIOrder.DefSQStaticMethod(engine, &AIOrder::SetOrderCompareFunction, "SetOrderCompareFunction", 4, ".iii"); SQAIOrder.DefSQStaticMethod(engine, &AIOrder::SetOrderCompareValue, "SetOrderCompareValue", 4, ".iii"); + SQAIOrder.DefSQStaticMethod(engine, &AIOrder::SetStopLocation, "SetStopLocation", 4, ".iii"); SQAIOrder.DefSQStaticMethod(engine, &AIOrder::AppendOrder, "AppendOrder", 4, ".iii"); SQAIOrder.DefSQStaticMethod(engine, &AIOrder::AppendConditionalOrder, "AppendConditionalOrder", 3, ".ii"); SQAIOrder.DefSQStaticMethod(engine, &AIOrder::InsertOrder, "InsertOrder", 5, ".iiii"); -- cgit v1.2.3-54-g00ecf