Class TrashBag
A furniture is an instance of a FurnitureType which is placed in the world, or in a PersonLike's hand. To register a custom furniture, use Register(TypeSettings).
public class TrashBag : Furniture, IGenericDataHolder, IContainerObject<Furniture>, IUpdatingObject
- Inheritance
-
JsonTypeSafeGenericDataHolderTrashBag
- Implements
-
IGenericDataHolder
- Inherited Members
-
JsonTypeSafeGenericDataHolder.GetDataKeys()
- Extension Methods
Constructors
TrashBag(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 TrashBag(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.
Fields
Content
A collection of the Furniture items that this trash bag contains.
[DataMember]
public readonly List<Furniture> Content
Field Value
Methods
AddContent(Furniture)
public bool AddContent(Furniture content)
Parameters
contentFurniture
Returns
RemoveContent(Furniture)
public bool RemoveContent(Furniture content)
Parameters
contentFurniture
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 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