Table of Contents

Class Gravestone

Namespace
TinyLife.Objects
Assembly
TinyLife.dll

A gravestone is a Furniture object that stores a dead PersonLike, as well as the DeathReason for their death, in DeadPerson and Reason, respectively. The set of all dead people stored in a gravestone on a map can be gathered using GetStoredDeadPeople().

public class Gravestone : Furniture, IGenericDataHolder, IUpdatingObject, IContainerObject<PersonLike>
Inheritance
JsonTypeSafeGenericDataHolder
Gravestone
Implements
IGenericDataHolder
Inherited Members
JsonTypeSafeGenericDataHolder.GetDataKeys()
Extension Methods

Constructors

Gravestone(Guid, FurnitureType, int[], Map, Vector2, float)

Creates a new furniture instance. By default, this is done using Construct<T>(int[], Map, Vector2, float, Guid?).

public Gravestone(Guid id, FurnitureType type, int[] colors, Map map, Vector2 pos, float floor)

Parameters

id Guid

The id to apply to the created furniture instance

type FurnitureType

The type to create an instance of

colors int[]

The colors to apply to the furniture

map Map

The map to create the furniture on

pos Vector2

The position that the furniture should have

floor float

The floor that this object is on.

Properties

Content

public IEnumerable<PersonLike> Content { get; }

Property Value

IEnumerable<PersonLike>

DeadPerson

The PersonLike that is stored in this gravestone. A set of all people stored in gravestones on a map can be gathered using GetStoredDeadPeople().

[DataMember]
[JsonConverter(typeof(Gravestone.PersonLikeConverter))]
public virtual PersonLike DeadPerson { get; set; }

Property Value

PersonLike

Engraving

A string of text that is displayed when hovering over this gravestone using the cursor. The engraving can be edited by the player using the EngraveGravestone action.

[DataMember]
public virtual string Engraving { get; set; }

Property Value

string

Reason

The DeathReason for this gravestone's DeadPerson's death

[DataMember]
public virtual DeathReason Reason { get; set; }

Property Value

DeathReason

Methods

AddContent(PersonLike)

public bool AddContent(PersonLike content)

Parameters

content PersonLike

Returns

bool

GetDescription(List<string>, bool)

This method allows adding a set of strings to the description list that get displayed when the object is hovered over in the build mode or household storage UIs. By default, this method adds various strings related to the ElectricityRating, Quality, Creator, and also invokes the OnGetDescription event.

public override void GetDescription(List<string> description, bool forHoverInfo)

Parameters

description List<string>

The description to add to.

forHoverInfo bool

Whether this method is being called by GetHoverInfo(Tooltip) (or by build mode).

GetPathCostModifier(Point)

Returns a modifier that indicates the "cost" for pathfinding over this object. If this object is a Furniture object, it has to have the NonColliding category for the returned value to have an effect. Note that, if this object moves, MarkDirtyForPathfinding(Point, int) should be invoked for its previous and resulting Position. By default, this method returns 0, meaning no additional pathfinding cost is added.

public override float GetPathCostModifier(Point position)

Parameters

position Point

The position whose path cost modifier is being calculated.

Returns

float

This object's path cost modifier for the given position

RemoveContent(PersonLike)

public bool RemoveContent(PersonLike content)

Parameters

content PersonLike

Returns

bool

Update(GameTime, TimeSpan, float)

The update method, which is called every update frame by the underlying Map, as well as additional places like the FurnitureStorage. Because of this, some actions might only want to be invoked if an object IsInWorld. To call this method while invoking all required events, use DoUpdate(GameTime, TimeSpan, float).

public virtual void Update(GameTime time, TimeSpan passedInGame, float speedMultiplier)

Parameters

time GameTime

The game's time

passedInGame TimeSpan

The amount of time that has passed since the last call

speedMultiplier float

The game speed multiplier, which represents how fast things should happen, which is usually determined by Speed

Validate(AppliedMigrations)

This method is called when this object is loaded from disk. Returning false on this method causes the object to be removed from the map. By default, this method invokes OnValidated and OnEventsAttachable.

public override bool Validate(AppliedMigrations appliedMigrations)

Parameters

appliedMigrations AppliedMigrations

Returns

bool

false if the object is not valid, true otherwise