mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 14:27:16 +00:00
(svn r25969) -Add: [Script] ScriptTown::GetFundBuildingsDuration.
This commit is contained in:
parent
9a41aefcc4
commit
17eb3ee9df
@ -69,6 +69,7 @@ void SQAITown_Register(Squirrel *engine)
|
||||
SQAITown.DefSQStaticMethod(engine, &ScriptTown::HasStatue, "HasStatue", 2, ".i");
|
||||
SQAITown.DefSQStaticMethod(engine, &ScriptTown::IsCity, "IsCity", 2, ".i");
|
||||
SQAITown.DefSQStaticMethod(engine, &ScriptTown::GetRoadReworkDuration, "GetRoadReworkDuration", 2, ".i");
|
||||
SQAITown.DefSQStaticMethod(engine, &ScriptTown::GetFundBuildingsDuration, "GetFundBuildingsDuration", 2, ".i");
|
||||
SQAITown.DefSQStaticMethod(engine, &ScriptTown::GetExclusiveRightsCompany, "GetExclusiveRightsCompany", 2, ".i");
|
||||
SQAITown.DefSQStaticMethod(engine, &ScriptTown::GetExclusiveRightsDuration, "GetExclusiveRightsDuration", 2, ".i");
|
||||
SQAITown.DefSQStaticMethod(engine, &ScriptTown::IsActionAvailable, "IsActionAvailable", 3, ".ii");
|
||||
|
@ -23,6 +23,7 @@
|
||||
* \li AIStation::HasCargoRating
|
||||
* \li AITile::GetTerrainType
|
||||
* \li AITown::FoundTown
|
||||
* \li AITown::GetFundBuildingsDuration
|
||||
* \li AITown::TOWN_GROWTH_NONE
|
||||
*
|
||||
* Other changes:
|
||||
|
@ -73,6 +73,7 @@ void SQGSTown_Register(Squirrel *engine)
|
||||
SQGSTown.DefSQStaticMethod(engine, &ScriptTown::HasStatue, "HasStatue", 2, ".i");
|
||||
SQGSTown.DefSQStaticMethod(engine, &ScriptTown::IsCity, "IsCity", 2, ".i");
|
||||
SQGSTown.DefSQStaticMethod(engine, &ScriptTown::GetRoadReworkDuration, "GetRoadReworkDuration", 2, ".i");
|
||||
SQGSTown.DefSQStaticMethod(engine, &ScriptTown::GetFundBuildingsDuration, "GetFundBuildingsDuration", 2, ".i");
|
||||
SQGSTown.DefSQStaticMethod(engine, &ScriptTown::GetExclusiveRightsCompany, "GetExclusiveRightsCompany", 2, ".i");
|
||||
SQGSTown.DefSQStaticMethod(engine, &ScriptTown::GetExclusiveRightsDuration, "GetExclusiveRightsDuration", 2, ".i");
|
||||
SQGSTown.DefSQStaticMethod(engine, &ScriptTown::IsActionAvailable, "IsActionAvailable", 3, ".ii");
|
||||
|
@ -29,6 +29,7 @@
|
||||
* \li GSStoryPage
|
||||
* \li GSTile::GetTerrainType
|
||||
* \li GSTown::FoundTown
|
||||
* \li GSTown::GetFundBuildingsDuration
|
||||
* \li GSTown::SetName
|
||||
* \li GSTown::TOWN_GROWTH_NONE
|
||||
* \li GSTown::TOWN_GROWTH_NORMAL
|
||||
|
@ -228,6 +228,13 @@
|
||||
return ::Town::Get(town_id)->road_build_months;
|
||||
}
|
||||
|
||||
/* static */ int ScriptTown::GetFundBuildingsDuration(TownID town_id)
|
||||
{
|
||||
if (!IsValidTown(town_id)) return -1;
|
||||
|
||||
return ::Town::Get(town_id)->fund_buildings_months;
|
||||
}
|
||||
|
||||
/* static */ ScriptCompany::CompanyID ScriptTown::GetExclusiveRightsCompany(TownID town_id)
|
||||
{
|
||||
if (ScriptObject::GetCompany() == OWNER_DEITY) return ScriptCompany::COMPANY_INVALID;
|
||||
|
@ -333,6 +333,15 @@ public:
|
||||
*/
|
||||
static int GetRoadReworkDuration(TownID town_id);
|
||||
|
||||
/**
|
||||
* Find out how long new buildings are still being funded in a town.
|
||||
* @param town_id The town to check.
|
||||
* @pre IsValidTown(town_id).
|
||||
* @return The number of months building construction is still funded.
|
||||
* The value 0 means that there is currently no funding.
|
||||
*/
|
||||
static int GetFundBuildingsDuration(TownID town_id);
|
||||
|
||||
/**
|
||||
* Find out which company currently has the exclusive rights of this town.
|
||||
* @param town_id The town to check.
|
||||
|
Loading…
Reference in New Issue
Block a user