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
floor
intThe floor that this wall is on.
positions
Point[]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
map
MapThe map to draw this wall on
time
GameTimeThe game time
batch
SpriteBatchThe sprite batch to draw with
drawPos
Vector2The position to draw the wall at, in draw space
overrideColor
Color?A color that this object should be rendered with, instead of its default color
drawOpening
boolWhether this wall-like object's Opening should be drawn.
isInWorld
boolWhether 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 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 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
map
MapThe map.
Validate(Map, AppliedMigrations)
This method is called when this object is loaded from disk.
public override bool Validate(Map map, AppliedMigrations appliedMigrations)
Parameters
map
MapappliedMigrations
AppliedMigrations
Returns
- bool
false if the object is not valid, true otherwise