Class Roof
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
RoofTypeThe type of the roof
area
RectangleThe area that this roof covers
rotation
Direction2This roof's rotation
color
intThe 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
Type
The RoofType that this roof has
[DataMember]
public readonly RoofType Type
Field Value
Wallpaper
The Wallpaper that is applied to this roof. This defaults to the Default wallpaper.
[DataMember]
public Wallpaper Wallpaper
Field Value
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
RoomThe room to add roofing to
action
UndoableActionThe 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
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
Vector2The 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