Wait stations
A wait station is a place in the world where the player waits, such as a work station: the player uses it and time passes. These calls list the stations in the scene you are in, check whether one can be used, use one, and tell you when a wait at a station ends.
WaitStations list, check and use wait stations
Use it to list the stations in the scene, check whether one can be used, use one, and hear when a wait at a station ends.
public static class WaitStations
{
public static List<WaitStationInfo> All();
public static bool CanUse(string id);
public static bool Use(string id);
public static event Action<WaitStationDoneArgs> Finished;
}
| Method | Returns | What it does |
|---|---|---|
All() | List<WaitStationInfo> | Every wait station in the scene you are in. |
CanUse(id) | bool | true when Use would start the wait. Starts nothing. |
Use(id) | bool | Uses the station, as if the player pressed its Interact key. |
| Event | Gives you | When it fires |
|---|---|---|
Finished | WaitStationDoneArgs | A wait at a station has ended. |
WaitStationInfo one wait station
WaitStations.All() gives you one of these for each station in the scene. Pass its Id to CanUse or Use.
public sealed class WaitStationInfo
{
public string Id { get; }
public WaitKind? Type { get; }
public int Minutes { get; }
public bool IgnoresNeeds { get; }
public bool CanWait { get; }
public bool SatisfiesHunger { get; }
public bool SatisfiesThirst { get; }
public bool SatisfiesBladder { get; }
public bool SatisfiesBowel { get; }
public bool SatisfiesTiredness { get; }
public bool SatisfiesHygiene { get; }
}
| Property | Type | What it means |
|---|---|---|
Id | string | The station’s id in the scene. |
Type | WaitKind? | What the wait is. null when it is not one of the WaitKind values. |
Minutes | int | How long the wait lasts, in game minutes. |
IgnoresNeeds | bool | true when the station ignores the player’s needs. |
CanWait | bool | true when the station would let the player wait right now. false without a player. |
SatisfiesHunger | bool | The wait counts as meeting this need. |
SatisfiesThirst | bool | The wait counts as meeting this need. |
SatisfiesBladder | bool | The wait counts as meeting this need. |
SatisfiesBowel | bool | The wait counts as meeting this need. |
SatisfiesTiredness | bool | The wait counts as meeting this need. |
SatisfiesHygiene | bool | The wait counts as meeting this need. |
WaitStationDoneArgs what you are told when a wait at a station ends
WaitStations.Finished hands you one of these when a wait at a station ends. Id says which station it was.
public sealed class WaitStationDoneArgs
{
public string Id { get; }
public int Seconds { get; }
}
| Property | Type | What it means |
|---|---|---|
Id | string | The station’s id. |
Seconds | int | How long the player waited, in game seconds. |
Things to know
All()lists every active wait station in the scene you are in. Job stations and resident stations are included. It only reads, and gives an empty list when the scene has no station or when a read fails (which is logged once). (It lists every activeInteractableWait. Job stations (InteractableWaitWork) and resident stations (InteractableWaitResident) derive from it. It reads the protectedWaitInMinutesandtypefields by reflection.)Typeis what kind of wait the station is, ornullwhen it is a kind thatWaitKinddoes not have. To start the same wait yourself, callPlayerState.Wait(Minutes * 60, Type.Value)whenTypehas a value. (It is the station’sWaitingController.Type.None,Sleeping,PassoutandArrestare not inWaitKind, so they come backnull.)IgnoresNeedsand theSatisfies...values describe how the wait treats the player’s needs. A resident station looks up its resident after the wait starts, so itsSatisfies...values can change during a wait. Read them when no wait is running. (IgnoresNeedsreads the protectedignorePlayerNeedsfield by reflection, andFindResidentAndApartmentruns after the wait starts.)CanUse(id)andUse(id)make the same checks, in this order: the id is not empty; no save is loading or being written; the game’s waiting controller exists; no level change is running; waiting is not blocked; the player is not asleep or waiting; the game’s stats, screens, clock and use text exist; the id matches a station; the station’s interaction is not turned off; and the station says the player can wait.Usethen does what pressing the station’s Interact key does. (The checks needPlayerStats,GameUIController,GameController,TimeOfDayAzureandUseText. The station checks areIsInteractDisabled()being false andCanWait()being true.Usecalls the station’sInteract().)Finishedfires for every wait that a station starts, including a wait the player wakes from early.Secondsis the time the game reports when it wakes the player, not the planned length. It does not fire for 0 or less, or while a save is loading or being written. At a job station it fires before the pay is added and beforeJobs.Workedfires. (It is a postfix onInteractableWait.WaitDone. The job station’sWaitDonecalls the base method first.)
Limits
- Neither
CanUsenorUsechecks distance, line of sight or skill, andUsedoes not check skill on a job station. - The station’s negative effects are not listed in
WaitStationInfo.