Add ride age and improve documentation

This commit is contained in:
Ted John committed 2020-05-23 15:28:03 +01:00
1 parent f4fb456c50
commit da8f21fb70
2 files changed
+13

No files matched your search

+6
View File
@@ -771,9 +771,15 @@ declare global {
/**
* The date in months when the ride was built.
* Subtract this from `date.monthsElapsed` to get the age.
*/
buildDate: number;
/**
* How old the ride is in months.
*/
readonly age: number;
/**
* The running cost of the ride billed every fortnight. Multiply this by 16 to get the cost per hour (~ 1 year).
*/
+7
View File
@@ -561,6 +561,12 @@ namespace OpenRCT2::Scripting
}
}
int32_t age_get() const
{
auto ride = GetRide();
return ride != nullptr ? ride->GetAge() : 0;
}
int16_t runningCost_get() const
{
auto ride = GetRide();
@@ -651,6 +657,7 @@ namespace OpenRCT2::Scripting
dukglue_register_property(ctx, &ScRide::nausea_get, &ScRide::nausea_set, "nausea");
dukglue_register_property(ctx, &ScRide::totalCustomers_get, &ScRide::totalCustomers_set, "totalCustomers");
dukglue_register_property(ctx, &ScRide::buildDate_get, &ScRide::buildDate_set, "buildDate");
dukglue_register_property(ctx, &ScRide::age_get, nullptr, "age");
dukglue_register_property(ctx, &ScRide::runningCost_get, &ScRide::runningCost_set, "runningCost");
dukglue_register_property(
ctx, &ScRide::inspectionInterval_get, &ScRide::inspectionInterval_set, "inspectionInterval");