Table of Contents

Class AnimatedDoor

Namespace
TinyLife.World
Assembly
Tiny Life.dll

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 OpeningType

The 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

map Map
wall WallLike
obj MapObject

Returns

bool

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 OpeningType

The type.

colors int[]

The colors.

wall WallLike

The 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 GameTime

The game's time

batch SpriteBatch

The sprite batch to use for drawing

map Map

The map that the opening is on

wall WallLike

The wall that the opening is in

drawPos Vector2

The position, in screen space, to draw the opening on

vertical bool

Whether the wall that the opening is on is vertical

scale float

The 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

map Map

The map that the opening is on

wall WallLike

The wall that the opening is in

Returns

bool

Whether this opening is currently open