TinyLifeExampleMod/Api/TinyLife/World/Household.md

4.6 KiB

Household

Namespace: TinyLife > World

Assembly: Tiny Life.dll

Implements IGenericDataHolder

Summary

A household is a set of TinyLife.Objects.Person instances that live together on the same TinyLife.World.Household.Lot

Constructors

Name Summary
Household ( Map, Lot ) Creates a new household on the given map and lot

Fields

Type Name Summary
HashSet<WornClothes> ClothesStorage This household's clothing storage, which is a set of TinyLife.Objects.WornClothes that are not currently being worn by any members, but that are owned by this household
HashSet<Furniture> FurnitureStorage This household's furniture storage, which is a set of TinyLife.Objects.Furniture items that are not placed, but owned by this household

Properties

Type Name Summary
Boolean IsCurrent A property that indicates whether or not this household is the same as TinyLife.GameImpl.CurrentHousehold
Lot Lot The TinyLife.World.Household.Lot that this household lives on. For exported households, this might be null.
IEnumerable<Person> Members The TinyLife.Objects.Person instances that are members of this household
Single Money The money that this household has, rounded by two digits after the decimal point
String Name The name of this household. The name of a household is the TinyLife.Objects.Person.LastName that most people in this household have.

Methods

Return Name Summary
void Add ( Person ) Adds the given person to this household
ExportedHousehold Export ( ) Exports this household's data into an TinyLife.World.ExportedHousehold, which can be saved to disk independently of the TinyLife.World.Map that this household is on.
Single GetAverageFriendshipTo ( Person ) Returns the average friendship level that the given TinyLife.Objects.Person has with members of this lot. This method returns an averaged value of the TinyLife.Relationship.FriendLevel that this person has towards each member of this lot.
Boolean HasMember ( Person ) Returns whether the given person is a part of this household
Boolean HasMember ( Guid ) Returns whether the given person TinyLife.Objects.MapObject.Id is a part of this household
void Import ( ExportedHousehold ) Imports the given TinyLife.World.ExportedHousehold into this household. Note that existing TinyLife.World.Household.Members are not removed or replaced beforehand.
Boolean IsLotVisible ( Lot ) Returns whether the given lot is considered visible to this household Note that passing this household's TinyLife.World.Household.Lot will always cause this method to return true.
void MarkLotNonVisible ( Lot ) Marks a lot non-visible if it's currently visible.
void MarkLotVisible ( Lot ) Marks the given lot as visible for members of this household. TinyLife.Objects.Person.VisitLot(TinyLife.World.Lot) should be used in favor of this method in most cases. By default, visibility lasts for 30 seconds of real time.
void Remove ( Person ) Removes the given person from this household, if they're part of it
void Update ( GameTime, TimeSpan, GameSpeed ) Updates this household, ticking down the lot visibility times
Boolean Validate ( Map )