RvRepairVanApi
public static class RvRepairVanApiNamespace RVRepairVan.Api
The RV’s state for other mods: whether Marco repaired it, which upgrades it has, and where it is while someone drives it. Read it after the world has loaded; before that every value is the empty state.
Co-op: the host owns the state and syncs it, so a client reads the host’s values. The events fire on every machine where the value changes, the host and each client. A save that loads already repaired raises no event; read IsRepaired once the world is up. A client that joins a host with a repaired RV gets the events when the host’s state arrives.
Fields
Section titled “Fields”ApiVersion
Section titled “ApiVersion”public const int ApiVersion = 1Raised by additions to this API. 1: state, events, vehicle, send home.
Properties
Section titled “Properties”IsRepaired
Section titled “IsRepaired”public static bool IsRepaired { get; }Marco has repaired the RV in this save.
HasEngine
Section titled “HasEngine”public static bool HasEngine { get; }The engine upgrade is bought: the RV can be driven.
EnginePrice
Section titled “EnginePrice”public static int EnginePrice { get; }What Marco asks for the engine upgrade, from this player’s settings.
IsEnabled
Section titled “IsEnabled”public static bool IsEnabled { get; }The mod is switched on in its settings.
Vehicle
Section titled “Vehicle”public static LandVehicle Vehicle { get; }The vehicle the RV rides on while it is off its spot or someone drives it, or null while it stands at home. Its transform is the RV’s position on the road.
IsDriving
Section titled “IsDriving”public static bool IsDriving { get; }True while someone sits at the RV’s wheel.
IsHome
Section titled “IsHome”public static bool IsHome { get; }The RV stands on its spot at the RV property.
Events
Section titled “Events”Repaired
Section titled “Repaired”public static event Action RepairedRaised when the RV becomes repaired during play.
EngineBought
Section titled “EngineBought”public static event Action EngineBoughtRaised when the engine upgrade is bought during play.
Methods
Section titled “Methods”TryGetPosition
Section titled “TryGetPosition”public static bool TryGetPosition(out Vector3 position)The RV’s position: on the road while it is out, else its spot. False before the world has loaded.
Contains
Section titled “Contains”public static bool Contains(Vector3 world, float margin = 0.3f)A world point lies in the RV’s body, or within margin metres of its sides, while the RV is on the road. Use it to tell who rides along. Always false while the RV stands at home.
SendHome
Section titled “SendHome”public static bool SendHome(string reason)Host: put the RV back on its spot at the RV property now, wherever it is. A driver at the wheel is taken out first. False on a co-op client. reason goes into the log.