Table of Contents

Class Room

Namespace
TinyLife.World
Assembly
Tiny Life.dll

A room is an area on a Map that is surrounded by Wall objects

public class Room
Inheritance
Room
Inherited Members
Extension Methods

Fields

Center

The position that is considered to be the center of this room. This is the average of all of its covered Tiles, and the MapSection that this room is on is determined by this value.

public readonly Point Center

Field Value

Point

CoveredSections

A set of MapSection instances that are covered by this room

public readonly HashSet<MapSection> CoveredSections

Field Value

HashSet<MapSection>

Floor

The floor that this room is on.

public readonly int Floor

Field Value

int

Map

The map that this room is on

public readonly Map Map

Field Value

Map

Tiles

A set of Microsoft.Xna.Framework.Point positions on the Map that are contained in this room

public readonly HashSet<Point> Tiles

Field Value

HashSet<Point>

Properties

FullyRoofed

A property that stores whether this room is fully roofed, that is, whether all of its Tiles are covered by a Roof or Tile or another room that is fully roofed. This property is evaluated automatically in Validate().

public bool FullyRoofed { get; }

Property Value

bool

HasOpeningsToOutside

A property that stores whether this room has any openings to the outside. If this value is false, this room will not be rendered at all if the lot that it is on is hidden, and this room is FullyRoofed. This property is evaluated automatically in Validate().

public bool HasOpeningsToOutside { get; }

Property Value

bool

Methods

GetConnectedRooms(Person)

Returns a set of Room objects which are connected to this room. A connected room is a room that is directly adjacent, and that a Person can walk into through an Opening.

public IEnumerable<Room> GetConnectedRooms(Person person)

Parameters

person Person

Returns

IEnumerable<Room>

A set of connected rooms

GetDecorativeRating()

Returns the combined decorative rating of all of the Furniture in this room. This method uses the DecorativeRating function.

public int GetDecorativeRating()

Returns

int

The combined decorative rating

GetLights()

Returns all of the Light instances that are contained in this room

public IEnumerable<Light> GetLights()

Returns

IEnumerable<Light>

All of the lights in this room

GetObjects<T>()

Returns all of the MapObject instances that are contained in this room

public IEnumerable<T> GetObjects<T>() where T : MapObject

Returns

IEnumerable<T>

All of the objects in this room

Type Parameters

T

GetStairs()

Returns all of the stairs that are present in this room. This includes only stairs whose bottom positions are part of the room.

public IEnumerable<Stairs> GetStairs()

Returns

IEnumerable<Stairs>

The stairs in this room.

GetWalls(bool)

Returns all of the Wall instances that are border walls or internal walls of this room. An internal wall is a wall for which both sides are contained in the room, rather than just one.

public IEnumerable<(Wall, int)> GetWalls(bool borderOnly)

Parameters

borderOnly bool

Whether to return border walls only, or include internal walls

Returns

IEnumerable<(Wall, int)>

A set of walls and their included sides of this room

IsSameRoom(ICollection<Point>, int)

Returns whether this room has the same covered Tiles as the given collection

public bool IsSameRoom(ICollection<Point> tiles, int floor)

Parameters

tiles ICollection<Point>

The tiles to query.

floor int

The floor to query.

Returns

bool

true if the covered tiles are the same, false otherwise

Validate()

This method is called in ValidateRooms(Point, int) to ensure that this room is still valid

public bool Validate()

Returns

bool

false if the object is not valid, true otherwise