Table of Contents

Class Roof

Namespace
TinyLife.World
Assembly
Tiny Life.dll

A roof is an object on a Map that is on a higher level and cannot be interacted with by people

[DataContract]
public class Roof
Inheritance
Roof
Inherited Members
Extension Methods

Constructors

Roof(RoofType, Rectangle, Direction2, int)

Creates a new roof with the given settings

public Roof(RoofType type, Rectangle area, Direction2 rotation, int color)

Parameters

type RoofType

The type of the roof

area Rectangle

The area that this roof covers

rotation Direction2

This roof's rotation

color int

The color that this roof's wallpaper should have

Fields

Color

The color index in in WarmDark that this roof uses for its top

[DataMember]
public readonly int Color

Field Value

int

Type

The RoofType that this roof has

[DataMember]
public readonly RoofType Type

Field Value

RoofType

Wallpaper

The Wallpaper that is applied to this roof. This defaults to the Default wallpaper.

[DataMember]
public Wallpaper Wallpaper

Field Value

Wallpaper

Properties

Area

The area that this roof covers

[DataMember]
public Rectangle Area { get; }

Property Value

Rectangle

Rotation

The rotation that this roof has. This is only relevant for roofs that don't have the Flat style.

[DataMember]
public Direction2 Rotation { get; }

Property Value

Direction2

Methods

GenerateRoof(Room, UndoableAction)

Generates the roofing for the given Room and adds it to the map. The generated roofing is split into as few separate parts as possible by ordering the tiles the room covers.

public static void GenerateRoof(Room room, UndoableAction action)

Parameters

room Room

The room to add roofing to

action UndoableAction

The undoable action that this method should add its actions to. If this method should be executed immediately, use the UndoableAction immediate constructor.

GetPrice()

public float GetPrice()

Returns

float

GetRoofAttachedFurnitureOffset(Vector2)

Returns the offset that Furniture attached to this roof should have when rendering. This method uses GetGableOffset(Rectangle, Direction2, Point) internally.

public (Vector2 DrawOffset, float DepthOffset) GetRoofAttachedFurnitureOffset(Vector2 position)

Parameters

position Vector2

The position that the furniture is on.

Returns

(Vector2 DrawOffset, float DepthOffset)

The draw and depth offset that the furniture should draw with.

Validate()

Validates this roof instance, which is automatically done in Validate(Action<string>, Action<float>) when the map is loaded from disk

public bool Validate()

Returns

bool

Whether this roof is still valid