Table of Contents

Class Television

Namespace
TinyLife.Objects
Assembly
Tiny Life.dll

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 Television : ScreenObject, IGenericDataHolder, IUpdatingObject
Inheritance
JsonTypeSafeGenericDataHolder
Television
Implements
IGenericDataHolder
Inherited Members
JsonTypeSafeGenericDataHolder.GetDataKeys()
Extension Methods

Constructors

Television(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 Television(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

CurrentChannel

The channel that is currently playing on this TV. If the TV is off, null is returned. Setting the channel through this property will automatically turn the TV on or off with the channel's default screen content (ScreenContent(Channel)).

public Television.Channel? CurrentChannel { get; set; }

Property Value

Television.Channel?

Methods

GetSeating(PersonLike, int)

Returns a furniture object that has the Chair category and that is in the GetViewingArea(int) of the given tv

public Furniture GetSeating(PersonLike person, int range = 5)

Parameters

person PersonLike

The person that wants to sit

range int

The range of the viewing area, or 5 by default

Returns

Furniture

A seat, or null if there is none

GetViewers(int)

Returns a set of PersonLike instances that are currently executing an action that extends WatchTvAction on the given tv

public IEnumerable<PersonLike> GetViewers(int range = 5)

Parameters

range int

The range of the viewing area, or 5 by default

Returns

IEnumerable<PersonLike>

Everyone watching the tv

GetViewingArea(int)

Returns a rectangle in world space that represents all possible positions for a PersonLike to stand or sit so they can see a tv's screen

public IEnumerable<Point> GetViewingArea(int range = 5)

Parameters

range int

The range of the viewing area, or 5 by default

Returns

IEnumerable<Point>

The viewing area of the tv

TurnOff()

Turns this screen object off

public override void TurnOff()

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 override 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