Breakable furniture is Furniture that can be Broken and then repaired.
An object of this class is automatically returned in Construct(int, Map, Vector2, Nullable<Guid>) if no ConstructedType is set.
public class BreakableFurniture : TinyLife.Objects.Furniture, TinyLife.Objects.IUpdatingObject
Creates a new furniture instance.
By default, this is done using Construct(int, Map, Vector2, Nullable<Guid>).
public BreakableFurniture(System.Guid id, TinyLife.Objects.FurnitureType type, int colors, TinyLife.World.Map map, Microsoft.Xna.Framework.Vector2 pos);
The id to apply to the created furniture instance
The type to create an instance of
The map to create the furniture on
The position that the furniture should have
A field that stores whether this furniture is currently broken
public bool Broken;
This method is called when an Action that this object is involved in updates, which is every Microsoft.Xna.Framework.Game.Update(Microsoft.Xna.Framework.GameTime) frame.
This object counts as involved in the action if its ActionInfo's GetInvolvedObjects<T>(ObjectCategory, bool) includes this object
By default, this method does nothing.
public override void ActionUpdate(TinyLife.Actions.Action action, Microsoft.Xna.Framework.GameTime time, System.TimeSpan passedInGame, TinyLife.GameSpeed speed, bool isAuxiliary);
The current game time
The amount of time that has passed, in game time
The game's current speed setting
Returns a set of lines that are displayed in build mode when this furniture is hovered over, either in the buy menu or in the FurnitureStorage.
By default, info about Reliability and ElectricityRating is returned.
public override System.Collections.Generic.IEnumerable<string> GetDescription();
Returns the price that this object can be bought or sold for.
Note that, like in the case of the Painting, the returned price isn't necessarily the full price that the object can be sold for. Instead, the price returned here should be the price that this object has when bought or sold from the FurnitureTool or similar.
public override float GetPrice();
The object's price
The update method, which is called every update frame by the underlying Map
public virtual void Update(Microsoft.Xna.Framework.GameTime time, System.TimeSpan passedInGame, TinyLife.GameSpeed speed);
The game's time
The amount of time that has passed since the last call
The game's speed
Implements Update(GameTime, TimeSpan, GameSpeed)
Causes this furniture to wear down, increasing the likelihood of it becoming Broken and randomly breaking it
public void WearDown(System.TimeSpan passedInGame);
The amount of in-game time that this furniture should be worn down by