src/ai/api/ai_vehiclelist.hpp.sq
branchnoai
changeset 9647 c17046b1b8a2
parent 9635 9ee82e091af7
child 9673 ee4f133c84ec
equal deleted inserted replaced
9646:1e63b7128e05 9647:c17046b1b8a2
    15 
    15 
    16 	SQAIVehicleList.DefSQStaticMethod(engine, &AIVehicleList::GetClassName, "GetClassName", 1, "x");
    16 	SQAIVehicleList.DefSQStaticMethod(engine, &AIVehicleList::GetClassName, "GetClassName", 1, "x");
    17 
    17 
    18 	SQAIVehicleList.PostRegister(engine);
    18 	SQAIVehicleList.PostRegister(engine);
    19 }
    19 }
       
    20 
       
    21 namespace SQConvert {
       
    22 	/* Allow AIStationVehicleList to be used as Squirrel parameter */
       
    23 	template <> AIStationVehicleList *GetParam(ForceType<AIStationVehicleList *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AIStationVehicleList *)instance; }
       
    24 	template <> AIStationVehicleList &GetParam(ForceType<AIStationVehicleList &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIStationVehicleList *)instance; }
       
    25 	template <> const AIStationVehicleList *GetParam(ForceType<const AIStationVehicleList *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AIStationVehicleList *)instance; }
       
    26 	template <> const AIStationVehicleList &GetParam(ForceType<const AIStationVehicleList &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIStationVehicleList *)instance; }
       
    27 }; // namespace SQConvert
       
    28 
       
    29 void SQAIStationVehicleListRegister(Squirrel *engine) {
       
    30 	DefSQClass <AIStationVehicleList> SQAIStationVehicleList("AIStationVehicleList");
       
    31 	SQAIStationVehicleList.PreRegister(engine, "AIAbstractList");
       
    32 	SQAIStationVehicleList.AddConstructor<void (AIStationVehicleList::*)(StationID station), 2>(engine, "xi");
       
    33 
       
    34 	SQAIStationVehicleList.DefSQStaticMethod(engine, &AIStationVehicleList::GetClassName, "GetClassName", 1, "x");
       
    35 
       
    36 	SQAIStationVehicleList.PostRegister(engine);
       
    37 }