src/ai/api/ai_station.hpp.sq
branchnoai
changeset 10094 e737405b06dd
parent 9866 efc38e1f559a
child 10212 1e0a2a182253
equal deleted inserted replaced
10093:b3849a19d137 10094:e737405b06dd
    18 void SQAIStation_Register(Squirrel *engine) {
    18 void SQAIStation_Register(Squirrel *engine) {
    19 	DefSQClass <AIStation> SQAIStation("AIStation");
    19 	DefSQClass <AIStation> SQAIStation("AIStation");
    20 	SQAIStation.PreRegister(engine);
    20 	SQAIStation.PreRegister(engine);
    21 	SQAIStation.AddConstructor<void (AIStation::*)(), 1>(engine, "x");
    21 	SQAIStation.AddConstructor<void (AIStation::*)(), 1>(engine, "x");
    22 
    22 
    23 	SQAIStation.DefSQConst(engine, AIStation::ERR_STATION_BASE,                       "ERR_STATION_BASE");
    23 	SQAIStation.DefSQConst(engine, AIStation::ERR_STATION_BASE,                         "ERR_STATION_BASE");
    24 	SQAIStation.DefSQConst(engine, AIStation::ERR_STATION_TOO_LARGE,                  "ERR_STATION_TOO_LARGE");
    24 	SQAIStation.DefSQConst(engine, AIStation::ERR_STATION_TOO_LARGE,                    "ERR_STATION_TOO_LARGE");
    25 	SQAIStation.DefSQConst(engine, AIStation::ERR_STATION_TOO_CLOSE_TO_OTHER_STATION, "ERR_STATION_TOO_CLOSE_TO_OTHER_STATION");
    25 	SQAIStation.DefSQConst(engine, AIStation::ERR_STATION_TOO_CLOSE_TO_ANOTHER_STATION, "ERR_STATION_TOO_CLOSE_TO_ANOTHER_STATION");
    26 	SQAIStation.DefSQConst(engine, AIStation::STATION_ANY,                            "STATION_ANY");
    26 	SQAIStation.DefSQConst(engine, AIStation::ERR_STATION_TOO_MANY_STATIONS,            "ERR_STATION_TOO_MANY_STATIONS");
    27 	SQAIStation.DefSQConst(engine, AIStation::STATION_TRAIN,                          "STATION_TRAIN");
    27 	SQAIStation.DefSQConst(engine, AIStation::ERR_STATION_TOO_MANY_STATIONS_IN_TOWN,    "ERR_STATION_TOO_MANY_STATIONS_IN_TOWN");
    28 	SQAIStation.DefSQConst(engine, AIStation::STATION_TRUCK_STOP,                     "STATION_TRUCK_STOP");
    28 	SQAIStation.DefSQConst(engine, AIStation::STATION_ANY,                              "STATION_ANY");
    29 	SQAIStation.DefSQConst(engine, AIStation::STATION_BUS_STOP,                       "STATION_BUS_STOP");
    29 	SQAIStation.DefSQConst(engine, AIStation::STATION_TRAIN,                            "STATION_TRAIN");
    30 	SQAIStation.DefSQConst(engine, AIStation::STATION_AIRPORT,                        "STATION_AIRPORT");
    30 	SQAIStation.DefSQConst(engine, AIStation::STATION_TRUCK_STOP,                       "STATION_TRUCK_STOP");
    31 	SQAIStation.DefSQConst(engine, AIStation::STATION_DOCK,                           "STATION_DOCK");
    31 	SQAIStation.DefSQConst(engine, AIStation::STATION_BUS_STOP,                         "STATION_BUS_STOP");
       
    32 	SQAIStation.DefSQConst(engine, AIStation::STATION_AIRPORT,                          "STATION_AIRPORT");
       
    33 	SQAIStation.DefSQConst(engine, AIStation::STATION_DOCK,                             "STATION_DOCK");
    32 
    34 
    33 	AIError::RegisterErrorMap(STR_306C_STATION_TOO_SPREAD_OUT,       AIStation::ERR_STATION_TOO_LARGE);
    35 	AIError::RegisterErrorMap(STR_306C_STATION_TOO_SPREAD_OUT,       AIStation::ERR_STATION_TOO_LARGE);
    34 	AIError::RegisterErrorMap(STR_300D_TOO_CLOSE_TO_ANOTHER_AIRPORT, AIStation::ERR_STATION_TOO_CLOSE_TO_OTHER_STATION);
    36 	AIError::RegisterErrorMap(STR_300D_TOO_CLOSE_TO_ANOTHER_AIRPORT, AIStation::ERR_STATION_TOO_CLOSE_TO_ANOTHER_STATION);
    35 	AIError::RegisterErrorMap(STR_3009_TOO_CLOSE_TO_ANOTHER_STATION, AIStation::ERR_STATION_TOO_CLOSE_TO_OTHER_STATION);
    37 	AIError::RegisterErrorMap(STR_3009_TOO_CLOSE_TO_ANOTHER_STATION, AIStation::ERR_STATION_TOO_CLOSE_TO_ANOTHER_STATION);
       
    38 	AIError::RegisterErrorMap(STR_304C_TOO_CLOSE_TO_ANOTHER_DOCK,    AIStation::ERR_STATION_TOO_CLOSE_TO_ANOTHER_STATION);
       
    39 	AIError::RegisterErrorMap(STR_3008_TOO_MANY_STATIONS_LOADING,    AIStation::ERR_STATION_TOO_MANY_STATIONS);
       
    40 	AIError::RegisterErrorMap(STR_TOO_MANY_TRUCK_STOPS,              AIStation::ERR_STATION_TOO_MANY_STATIONS);
       
    41 	AIError::RegisterErrorMap(STR_TOO_MANY_BUS_STOPS,                AIStation::ERR_STATION_TOO_MANY_STATIONS);
       
    42 	AIError::RegisterErrorMap(STR_3007_TOO_MANY_STATIONS_LOADING,    AIStation::ERR_STATION_TOO_MANY_STATIONS_IN_TOWN);
    36 
    43 
    37 	AIError::RegisterErrorMapString(AIStation::ERR_STATION_TOO_LARGE,                  "ERR_STATION_TOO_LARGE");
    44 	AIError::RegisterErrorMapString(AIStation::ERR_STATION_TOO_LARGE,                    "ERR_STATION_TOO_LARGE");
    38 	AIError::RegisterErrorMapString(AIStation::ERR_STATION_TOO_CLOSE_TO_OTHER_STATION, "ERR_STATION_TOO_CLOSE_TO_OTHER_STATION");
    45 	AIError::RegisterErrorMapString(AIStation::ERR_STATION_TOO_CLOSE_TO_ANOTHER_STATION, "ERR_STATION_TOO_CLOSE_TO_ANOTHER_STATION");
       
    46 	AIError::RegisterErrorMapString(AIStation::ERR_STATION_TOO_MANY_STATIONS,            "ERR_STATION_TOO_MANY_STATIONS");
       
    47 	AIError::RegisterErrorMapString(AIStation::ERR_STATION_TOO_MANY_STATIONS_IN_TOWN,    "ERR_STATION_TOO_MANY_STATIONS_IN_TOWN");
    39 
    48 
    40 	SQAIStation.DefSQStaticMethod(engine, &AIStation::GetClassName,               "GetClassName",               1, "x");
    49 	SQAIStation.DefSQStaticMethod(engine, &AIStation::GetClassName,               "GetClassName",               1, "x");
    41 	SQAIStation.DefSQStaticMethod(engine, &AIStation::IsValidStation,             "IsValidStation",             2, "xi");
    50 	SQAIStation.DefSQStaticMethod(engine, &AIStation::IsValidStation,             "IsValidStation",             2, "xi");
    42 	SQAIStation.DefSQStaticMethod(engine, &AIStation::GetStationID,               "GetStationID",               2, "xi");
    51 	SQAIStation.DefSQStaticMethod(engine, &AIStation::GetStationID,               "GetStationID",               2, "xi");
    43 	SQAIStation.DefSQStaticMethod(engine, &AIStation::GetName,                    "GetName",                    2, "xi");
    52 	SQAIStation.DefSQStaticMethod(engine, &AIStation::GetName,                    "GetName",                    2, "xi");