Class LightFurniture
A light furniture is a Furniture object that implements the required properties and methods of ILightObject.
public class LightFurniture : Furniture, IGenericDataHolder, IUpdatingObject, ILightObject
- Inheritance
-
JsonTypeSafeGenericDataHolderLightFurniture
- Implements
-
IGenericDataHolder
- Derived
- Inherited Members
-
JsonTypeSafeGenericDataHolder.GetDataKeys()
- Extension Methods
Constructors
LightFurniture(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 LightFurniture(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
IsDisabled
Whether this light is currently disabled. Note that a light also gets disabled if this object IsElectrical and AreUtilitiesDisabled is true, but this field will not be set to true in that case.
[DataMember]
public virtual bool IsDisabled { get; set; }
Property Value
LightSettings
The ILightObject.Settings that this light object operates under.
public virtual ILightObject.Settings LightSettings { get; }
Property Value
Lights
The lights that are currently in the world, based on this light object
public virtual Light[] Lights { get; }
Property Value
- Light[]
Methods
OnAdded()
This method is called when this object is added to a Map. By default, it does nothing.
public override void OnAdded()
OnCameraRotationChanged(Direction2, Direction2)
This method is invoked when the game's camera rotation changes. Additionally, the old and new rotations are passed.
public override void OnCameraRotationChanged(Direction2 oldRotation, Direction2 newRotation)
Parameters
oldRotationDirection2The old camera rotation
newRotationDirection2The new camera rotation
OnRemoved()
This method is called when this object is removed from a Map. By default, it does nothing.
public override void OnRemoved()
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