public sealed class HousePlotOne house: who may do what in it, and what is down.
Remarks
⚠ Nothing here takes a clock, and that is what makes doc 28's claim true. Housing is affordable because "ten thousand houses are ten thousand rows, not ten thousand processes" — and a plot only survives hibernation if it has nothing that has to keep running. There is no timer, no decay, no growth and no tick in this type; every question it answers is a function of what is stored. Anything that has to age — a plant that wilts, a rent clock — is the caller's, and is a timestamp compared on load rather than a process.
⚠ It reports what must happen and never holds anything. Removing a piece hands back the DefId that came out; whether it goes to a bag, to the mail or nowhere is the caller's, exactly as with a quest's rewards and an inventory's transfer order.
⚠ A ban beats everything, including the owner's own openness. Modelling a ban as the bottom rung of the tier ladder makes it useless on a house open to the public — everybody is on the bottom rung there, and the bottom rung is admitted.
⚠ An owner cannot be banned from, or demoted in, their own house. The alternative is a bug or a mis-click that locks somebody out of a house only a support ticket can reopen.
Fields and properties (10)
public HousingLibrary LibraryWhere the furniture comes from.
public Plot PlotWhat kind it is.
public HouseOwner OwnerWhose it is.
public HouseTier OpennessWhat a stranger is treated as.
public IReadOnlyList<Placement> PlacementsWhat is down, in the order it was placed.
public int SpentHow much of the budget is used.
public int FreeHow much is left. Negative for a plot a patch has made too small for its contents.
public int GrantedHow many people have been given standing.
public IEnumerable<PlayerId> BannedWho is barred, in id order.
public uint RevisionHow many times it has changed.
Methods (21)
public HousePlot(HousingLibrary library, Plot plot, HouseOwner owner)Makes an empty house.
public HouseTier TierOf(PlayerId player)What standing somebody has.
public bool IsBanned(PlayerId player)Whether somebody is barred.
public bool Can(PlayerId player, HouseAction action)Whether somebody may do something.
public HousingRefusal SetOpenness(PlayerId by, HouseTier openness)Opens or closes the house to strangers.
public HousingRefusal Grant(PlayerId by, PlayerId player, HouseTier tier)Gives somebody standing, or takes it away with None.
public HousingRefusal Ban(PlayerId by, PlayerId player)Bars somebody.
public HousingRefusal Unban(PlayerId by, PlayerId player)Lets somebody back in, at no standing.
public void Assign(PlayerId player, HouseTier tier)Sets somebody's standing with no checks at all.
public void Bar(PlayerId player, bool banned)Bars or unbars somebody with no checks at all. The authority's, like Assign.
public void Open(HouseTier openness)Sets what a stranger is treated as with no checks at all. The authority's.
public int CountOf(DefId furniture)How many of something is down.
public Placement? Find(int id)Finds a placement.
public HousingRefusal CanPlace(PlayerId by, Furniture furniture, HouseSurface surface, IRequirementContext? context = null)Whether a piece could be put down, and why not.
public HousingRefusal Place(PlayerId by, Furniture furniture, HouseSurface surface, Vector3 position, float yaw, out Placement placed, IRequirementContext? context = null, GameplayTagSet? grantTo = null)Puts a piece down.
public HousingRefusal Move(PlayerId by, int id, HouseSurface surface, Vector3 position, float yaw, out Placement moved)Moves a piece that is already down.
public HousingRefusal Remove(PlayerId by, int id, out DefId returned, GameplayTagSet? revokeFrom = null)Picks a piece up.
public HousingRefusal Clear(PlayerId by, ICollection<DefId> returned, GameplayTagSet? revokeFrom = null)Picks everything up.
public int Recount()What is spent, recomputed from what is down.
public void Restore(IEnumerable<Placement> saved)Puts a saved layout back, as it was, with no checks.
public int CollectTags(GameplayTagSet into)Every tag the furniture that is down grants.
Used by (1)
- HousingTestsVixen.Gameplay.Housing.Tests