Class SwingingDoor
An opening is some sort of extrusion in a Wall, like a window or a door. Openings are created from their underlying OpeningType.
Implements
Inherited Members
Namespace: TinyLife.World
Assembly: Tiny Life.dll
Syntax
public class SwingingDoor : Door, IPricedObject
Constructors
SwingingDoor(OpeningType, Int32[])
Creates a new opening from the given opening type and color
Declaration
public SwingingDoor(OpeningType type, int[] colors)
Parameters
Type | Name | Description |
---|---|---|
OpeningType | type | The opening type |
System.Int32[] | colors | The indices of the colors to use |
Fields
Lock
The lock type that this door is locked with, or 0 if the door is not locked
Declaration
[DataMember]
public LockType Lock
Field Value
Type | Description |
---|---|
LockType |
Methods
CanWalkThrough(Wall, Person)
Returns whether a Person is able to walk through a Wall that has this opening. This returns true for Door and SwingingDoor and false for Opening.
Declaration
public override bool CanWalkThrough(Wall wall, Person person)
Parameters
Type | Name | Description |
---|---|---|
Wall | wall | |
Person | person |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
Draw(GameTime, SpriteBatch, Map, Wall, Vector2, Boolean, Single, Single, Nullable<Color>)
Draws this opening in the world with the given settings
Declaration
public override void Draw(GameTime time, SpriteBatch batch, Map map, Wall wall, Vector2 drawPos, bool vertical, float scale, float depth, Color? overrideColor)
Parameters
Type | Name | Description |
---|---|---|
GameTime | time | The game's time |
SpriteBatch | batch | The sprite batch to use for drawing |
Map | map | The map that the opening is on |
Wall | wall | The wall that the opening is in |
Vector2 | drawPos | The position, in screen space, to draw the opening on |
System.Boolean | vertical | Whether the wall that the opening is on is vertical |
System.Single | scale | The scale to draw the opening with |
System.Single | depth | The depth to use for drawing the opening |
System.Nullable<Color> | overrideColor | A color that should be used instead of this opening's default color, or null to use the opening's default color |
Overrides
IsOpen(Map, Wall)
Calculates and returns whether this opening is currently open. This method returns true if any people that CanWalkThrough(Wall, Person) this door are close enough for it to display as opened.
Declaration
public virtual bool IsOpen(Map map, Wall wall)
Parameters
Type | Name | Description |
---|---|---|
Map | map | The map that the opening is on |
Wall | wall | The wall that the opening is in |
Returns
Type | Description |
---|---|
System.Boolean | Whether this opening is currently open |