mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-17 21:25:40 +00:00
(svn r17012) -Add [NoAI]: AIBaseStation::GetConstructionDate
This commit is contained in:
parent
86b89fda98
commit
1ae6096e3b
@ -45,3 +45,10 @@
|
|||||||
|
|
||||||
return ::BaseStation::Get(station_id)->xy;
|
return ::BaseStation::Get(station_id)->xy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* static */ int32 AIBaseStation::GetConstructionDate(StationID station_id)
|
||||||
|
{
|
||||||
|
if (!IsValidBaseStation(station_id)) return -1;
|
||||||
|
|
||||||
|
return ::BaseStation::Get(station_id)->build_date;
|
||||||
|
}
|
||||||
|
@ -61,6 +61,13 @@ public:
|
|||||||
* @return The tile the basestation is currently on.
|
* @return The tile the basestation is currently on.
|
||||||
*/
|
*/
|
||||||
static TileIndex GetLocation(StationID station_id);
|
static TileIndex GetLocation(StationID station_id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the last date a station part was added to this station.
|
||||||
|
* @param station_id The station to look at.
|
||||||
|
* @return The last date some part of this station was build.
|
||||||
|
*/
|
||||||
|
static int32 GetConstructionDate(StationID station_id);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* AI_BASESTATION_HPP */
|
#endif /* AI_BASESTATION_HPP */
|
||||||
|
@ -26,10 +26,11 @@ void SQAIBaseStation_Register(Squirrel *engine) {
|
|||||||
SQAIBaseStation.DefSQConst(engine, AIBaseStation::STATION_INVALID, "STATION_INVALID");
|
SQAIBaseStation.DefSQConst(engine, AIBaseStation::STATION_INVALID, "STATION_INVALID");
|
||||||
SQAIBaseStation.DefSQConst(engine, AIBaseStation::WAYPOINT_INVALID, "WAYPOINT_INVALID");
|
SQAIBaseStation.DefSQConst(engine, AIBaseStation::WAYPOINT_INVALID, "WAYPOINT_INVALID");
|
||||||
|
|
||||||
SQAIBaseStation.DefSQStaticMethod(engine, &AIBaseStation::IsValidBaseStation, "IsValidBaseStation", 2, ".i");
|
SQAIBaseStation.DefSQStaticMethod(engine, &AIBaseStation::IsValidBaseStation, "IsValidBaseStation", 2, ".i");
|
||||||
SQAIBaseStation.DefSQStaticMethod(engine, &AIBaseStation::GetName, "GetName", 2, ".i");
|
SQAIBaseStation.DefSQStaticMethod(engine, &AIBaseStation::GetName, "GetName", 2, ".i");
|
||||||
SQAIBaseStation.DefSQStaticMethod(engine, &AIBaseStation::SetName, "SetName", 3, ".is");
|
SQAIBaseStation.DefSQStaticMethod(engine, &AIBaseStation::SetName, "SetName", 3, ".is");
|
||||||
SQAIBaseStation.DefSQStaticMethod(engine, &AIBaseStation::GetLocation, "GetLocation", 2, ".i");
|
SQAIBaseStation.DefSQStaticMethod(engine, &AIBaseStation::GetLocation, "GetLocation", 2, ".i");
|
||||||
|
SQAIBaseStation.DefSQStaticMethod(engine, &AIBaseStation::GetConstructionDate, "GetConstructionDate", 2, ".i");
|
||||||
|
|
||||||
SQAIBaseStation.PostRegister(engine);
|
SQAIBaseStation.PostRegister(engine);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user