Class Opening
An opening is some sort of extrusion in a WallLike, like a window or a door. Openings are created from their underlying OpeningType.
[DataContract]
public class Opening
- Inheritance
-
Opening
- Derived
- Inherited Members
- Extension Methods
Constructors
Opening(OpeningType, int[])
Creates a new opening from the given opening type and color
public Opening(OpeningType type, int[] colors)
Parameters
type
OpeningTypeThe opening type
colors
int[]The indices of the colors to use
Fields
Colors
The indices of the OpeningType's Colors that this opening instance has.
[DataMember]
public int[] Colors
Field Value
- int[]
Migrations
The global set of migrations that should be applied to every Opening instance. To register migrations for specific opening types only, use Migrations.
public static readonly List<Migration<Opening>> Migrations
Field Value
Type
The OpeningType that this opening has
[DataMember]
public readonly OpeningType Type
Field Value
Methods
CanPlaceOn(FurnitureType)
Whether the given FurnitureType can be attached to this opening. By default, this method returns true when the furniture has the CanCoverWindow category.
public virtual bool CanPlaceOn(FurnitureType type)
Parameters
type
FurnitureType
Returns
- bool
Whether the opening is a window
CanWalkThrough(Map, WallLike, MapObject)
Returns whether a PersonLike is able to walk through a WallLike that has this opening. This returns true for WalkableOpening and LockableAnimatedDoor and false for Opening.
public virtual bool CanWalkThrough(Map map, WallLike wall, MapObject obj)
Parameters
Returns
Draw(GameTime, SpriteBatch, Map, WallLike, Vector2, bool, float, Color?)
Draws this opening in the world with the given settings
public virtual void Draw(GameTime time, SpriteBatch batch, Map map, WallLike wall, Vector2 drawPos, bool vertical, float scale, Color? overrideColor)
Parameters
time
GameTimeThe game's time
batch
SpriteBatchThe sprite batch to use for drawing
map
MapThe map that the opening is on
wall
WallLikeThe wall that the opening is in
drawPos
Vector2The position, in screen space, to draw the opening on
vertical
boolWhether the wall that the opening is on is vertical
scale
floatThe scale to draw the opening with
overrideColor
Color?A color that should be used instead of this opening's default color, or null to use the opening's default color
GetDescription()
Returns a set of strings that should be displayed if this opening is hovered over in build mode.
public virtual IEnumerable<string> GetDescription()
Returns
- IEnumerable<string>
A set of description strings for this opening.
Validate(WallLike, Map, AppliedMigrations)
Validates this opening, returning false if it is somehow invalid. This method is called when a Map is loaded.
public virtual bool Validate(WallLike wall, Map map, AppliedMigrations appliedMigrations)
Parameters
wall
WallLikeThe wall that this opening is on.
map
MapThe map that this opening is on.
appliedMigrations
AppliedMigrationsThe set of migrations that have already been applied on this object.
Returns
- bool
Whether this opening is valid.