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
typeOpeningTypeThe opening type
colorsint[]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
typeOpeningTypeThe type.
colorsint[]The colors.
wallWallLikeThe 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
timeGameTimeThe game's time
batchSpriteBatchThe sprite batch to use for drawing
mapMapThe map that the opening is on
wallWallLikeThe wall that the opening is in
drawPosVector2The position, in screen space, to draw the opening on
verticalboolWhether the wall that the opening is on is vertical
scalefloatThe scale to draw the opening with
overrideColorColor?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