Reading renovations
Renovations.All() and Renovations.Get(id) give you a RenovationInfo, a snapshot of one renovation taken when you asked. The snapshot does not update by itself, so ask again for fresh values. Text in brackets at the end of a note is extra detail for experienced modders, and you can skip it on a first read.
Renovations read the renovations
Use All() or Get to read the renovations, Progress to see how far a build has got, and Cost for the first payment.
public static class Renovations
{
public static List<RenovationInfo> All();
public static RenovationInfo Get(string id);
public static float Progress(string id);
public static int Cost(string id);
public static bool IsAvailable { get; }
}
| Method | Returns | What it does |
|---|---|---|
All() | List<RenovationInfo> | Every renovation the game has, ordered or not. |
Get(id) | RenovationInfo | One renovation. null when the id is not found. |
Progress(id) | float | How far the build has got, from 0 to 1. |
Cost(id) | int | The first payment in OC. 0 when the id is not found. |
| Property | Type | What it means |
|---|---|---|
IsAvailable | bool | true when the Finished event works. See Details. |
RenovationInfo a snapshot of one renovation
Renovations.All() and Renovations.Get give you these. Cost is the first payment in OC, and FinalCost is the final payment in RM.
public sealed class RenovationInfo
{
public string Id { get; }
public string Name { get; }
public int ApartmentId { get; }
public int Cost { get; }
public int FinalCost { get; }
public RenovationState State { get; }
}
| Property | Type | What it means |
|---|---|---|
Id | string | The renovation’s id. See the note on ids below. |
Name | string | The name the game shows for it. |
ApartmentId | int | The apartment number. 0 for a whole-building upgrade. |
Cost | int | The first payment, in OC. |
FinalCost | int | The final payment, in RM (Real Money). |
State | RenovationState | Where the renovation stands. See The states. |
RenovationState where a renovation stands
This is the value of RenovationInfo.State. Available is the state in which the player can order the renovation now.
public enum RenovationState
{
Locked,
Available,
InProgress,
AwaitingFinalPayment,
Installed
}
| Value | Meaning |
|---|---|
Locked | The player cannot order it yet. |
Available | The player can order it now. |
InProgress | It is ordered and the contractor is building it. |
AwaitingFinalPayment | The work is done and the player has to pay the final payment. |
Installed | It is finished and in the building. |
Things to know
- An id looks like
"<apartment number>/<upgrade id>". The apartment number is0for an upgrade of the whole building. Read ids fromAll(), and do not build them yourself. (General upgrades come fromTenementGeneral, and apartment upgrades useTenementApartment.apartmentNumber. The upgrade id isTenementUpgrade.Id.) All()lists every renovation the game offers for the building and for each apartment, whether or not the player can order it yet. If one of them cannot be described, it is skipped and logged once, and you still get the rest. A renovation that is the same in the same place is listed once. (It walks the general upgrade groups and each apartment type’s groups (TenementUpgradeGroup.updateGroup).)Costis the first payment after any change by theTweaksRenovationscost setting. The tweak changes the price the game reads, and this reads the same price. (It isTenementUpgrade.GetPriceStartOC, whichTweaksRenovations.CostMultiplierpatches.FinalCostisGetPriceFinalRM.)Progressis0when the renovation is not ordered, and1when it is installed or waiting for the final payment. While it is being built, it is how far the build has got. (WhileInProgressit isTenementUpgradeProgress.GetCurrentProgress.)