Class FenceWall
A fence wall is a type of WallLike that works similar to a Wall in placement, but is type-based and doesn't support wallpapering. Fence walls are an official replacement for the deprecated Fence furniture type.
public class FenceWall : WallLike, IGenericDataHolder
- Inheritance
-
JsonTypeSafeGenericDataHolderFenceWall
- Implements
-
IGenericDataHolder
- Inherited Members
-
JsonTypeSafeGenericDataHolder.GetDataKeys()
- Extension Methods
Constructors
FenceWall(FenceType, int[], int, params Point[])
public FenceWall(FenceType type, int[] colors, int floor, params Point[] positions)
Parameters
Fields
Colors
[DataMember]
public int[] Colors
Field Value
- int[]
Type
The FenceType that this fence has.
[DataMember]
public readonly FenceType Type
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.
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.
HasCollision(Map)
public override bool HasCollision(Map map)
Parameters
mapMap
Returns
OnNeighborChanged(Map, WallLike)
A method that is called when a neighboring wall of this wall changes. This method is called when a neighboring wall calls NotifyNeighbors(Map).
protected override void OnNeighborChanged(Map map, WallLike neighbor)
Parameters
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