Class AnimatedDoor
An opening is some sort of extrusion in a WallLike, like a window or a door. Openings are created from their underlying OpeningType.
public class AnimatedDoor : WalkableOpening
- Inheritance
-
AnimatedDoor
- Derived
- Inherited Members
- Extension Methods
Constructors
AnimatedDoor(OpeningType, int[])
Creates a new opening from the given opening type and color
public AnimatedDoor(OpeningType type, int[] colors)
Parameters
type
OpeningTypeThe opening type
colors
int[]The indices of the colors to use
Methods
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 override bool CanWalkThrough(Map map, WallLike wall, MapObject obj)
Parameters
Returns
Construct(OpeningType, int[], WallLike)
Constructs a new door with the given settings. This is a helper method that can be used through a method group when constructing a new OpeningType.
public static AnimatedDoor Construct(OpeningType type, int[] colors, WallLike wall)
Parameters
type
OpeningTypeThe type.
colors
int[]The colors.
wall
WallLikeThe wall.
Returns
- AnimatedDoor
The constructed door.
Draw(GameTime, SpriteBatch, Map, WallLike, Vector2, bool, float, Color?)
Draws this opening in the world with the given settings
public override 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
IsOpen(Map, WallLike)
Calculates and returns whether this opening is currently open. This method returns true if any people that CanWalkThrough(Map, WallLike, MapObject) this door are close enough for it to display as opened.
public virtual bool IsOpen(Map map, WallLike wall)
Parameters
Returns
- bool
Whether this opening is currently open