Class Gravestone
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
-
JsonTypeSafeGenericDataHolderGravestone
- 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
idGuidThe id to apply to the created furniture instance
typeFurnitureTypeThe type to create an instance of
colorsint[]The colors to apply to the furniture
mapMapThe map to create the furniture on
posVector2The position that the furniture should have
floorfloatThe floor that this object is on.
Properties
Content
public IEnumerable<PersonLike> Content { get; }
Property Value
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
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
Reason
The DeathReason for this gravestone's DeadPerson's death
[DataMember]
public virtual DeathReason Reason { get; set; }
Property Value
Methods
AddContent(PersonLike)
public bool AddContent(PersonLike content)
Parameters
contentPersonLike
Returns
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
descriptionList<string>The description to add to.
forHoverInfoboolWhether 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
positionPointThe 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
contentPersonLike
Returns
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
timeGameTimeThe game's time
passedInGameTimeSpanThe amount of time that has passed since the last call
speedMultiplierfloatThe 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
appliedMigrationsAppliedMigrations
Returns
- bool
false if the object is not valid, true otherwise