Class Wall
A wall is an element of a Map that stops traversal and that has a Wallpaper and optionally an Opening attached to it.
public class Wall : WallLike, IGenericDataHolder
- Inheritance
-
JsonTypeSafeGenericDataHolderWall
- Implements
-
IGenericDataHolder
- Inherited Members
-
JsonTypeSafeGenericDataHolder.GetDataKeys()
- Extension Methods
Constructors
Wall(int, params Point[])
Creates a new wall at the given position, with the implicitly given verticality
public Wall(int floor, params Point[] positions)
Parameters
floorintThe floor that this wall is on.
positionsPoint[]The positions that the wall should be placed between
Fields
Price
The price of building a single wall element
public const int Price = 125
Field Value
Wallpapers
The two wallpapers attached to this Wall, on either one of its sides
[DataMember]
public readonly Wallpaper[] Wallpapers
Field Value
Methods
Draw(Map, GameTime, SpriteBatch, Vector2, Color?, bool, bool)
Draws this wall in the world, along with its Opening and potentially Wallpapers or Type.
public override void Draw(Map map, GameTime time, SpriteBatch batch, Vector2 drawPos, Color? overrideColor = null, bool drawOpening = true, bool isInWorld = true)
Parameters
mapMapThe map to draw this wall on
timeGameTimeThe game time
batchSpriteBatchThe sprite batch to draw with
drawPosVector2The position to draw the wall at, in draw space
overrideColorColor?A color that this object should be rendered with, instead of its default color
drawOpeningboolWhether this wall-like object's Opening should be drawn.
isInWorldboolWhether this wall-like object is currently in the world, or just a preview.
GetDisplayMode()
Returns the WallMode that this wall should be rendered with. If the Opening is nonnull, its WallMode is returned.
public virtual WallMode GetDisplayMode()
Returns
- WallMode
The wall mode
GetPrice()
Returns the price for this wall, including its Opening as well as its Wallpapers or Type.
public override float GetPrice()
Returns
- float
The price.
IsDown()
Returns whether this wall should be rendered with a lower height than its actual height. If this value returns true, Draw(Map, GameTime, SpriteBatch, Vector2, Color?, bool, bool) only draws the first 5 or so pixels of the wall to allow for a simple view of what is behind the wall. This value is based on the lot visibility, the WallMode and more.
public virtual bool IsDown()
Returns
- bool
Whether the wall should be rendered down
OnAdded(Map)
Called when this wall is added to the given map.
By default, this method marks surrounding locations dirty for pathfinding and calls NotifyNeighbors(Map).
public override void OnAdded(Map map)
Parameters
mapMapThe map.
OnCameraRotationChanged(Map, Direction2, Direction2)
This method is invoked when the game's camera rotation changes. Additionally, the old and new rotations are passed.
public override void OnCameraRotationChanged(Map map, Direction2 oldRotation, Direction2 newRotation)
Parameters
mapMapoldRotationDirection2The old camera rotation
newRotationDirection2The new camera rotation
OnRoomChanged(Map)
public virtual void OnRoomChanged(Map map)
Parameters
mapMap
Validate(Map, AppliedMigrations)
This method is called when this object is loaded from disk.
public override bool Validate(Map map, AppliedMigrations appliedMigrations)
Parameters
mapMapappliedMigrationsAppliedMigrations
Returns
- bool
false if the object is not valid, true otherwise