Show / Hide Table of Contents

Class WaterDepthContext

It makes sure that the object is placed on water, it checks for a solid block within the given depth

Inheritance
System.Object
OccupancyContext
WaterDepthContext
Inherited Members
OccupancyContext.CurrentPlacementStatus(Vector3i, Quaternion)
Namespace: Eco.Gameplay.Occupancy
Assembly: Eco.Gameplay.dll
Syntax
public class WaterDepthContext : OccupancyContext

Constructors

WaterDepthContext(Int32, OccupancyInfo)

Allows to create water depth context from occupancy info, it caches the blocks attached to its down side as the positions to check depth.

Declaration
public WaterDepthContext(int depth, OccupancyInfo occupancyInfo)
Parameters
Type Name Description
System.Int32 depth
OccupancyInfo occupancyInfo

WaterDepthContext(Int32, List<Vector3i>)

Allows to create water depth context by manually setting the positions to check.

Declaration
public WaterDepthContext(int depth, List<Vector3i> positionsToCheck)
Parameters
Type Name Description
System.Int32 depth
System.Collections.Generic.List<Vector3i> positionsToCheck

Fields

Depth

Declaration
public readonly int Depth
Field Value
Type Description
System.Int32

PositionsToCheck

Declaration
public readonly List<Vector3i> PositionsToCheck
Field Value
Type Description
System.Collections.Generic.List<Vector3i>

Methods

CanPlaceObject(Player, IPlaceableItem, Vector3, Quaternion)

Placement logic for placing water depth, it checks that it is placed on top of water and that a solid block is found at maximum depth

Declaration
public override bool CanPlaceObject(Player player, IPlaceableItem item, Vector3 worldPos, Quaternion rotation)
Parameters
Type Name Description
Player player
IPlaceableItem item
System.Numerics.Vector3 worldPos
Quaternion rotation
Returns
Type Description
System.Boolean
Overrides
OccupancyContext.CanPlaceObject(Player, IPlaceableItem, Vector3, Quaternion)

GetRelevantChunkPositions(Vector3i, Quaternion)

Returns chunks related to the generated downward columns of positions from the positions to check and depth.

Declaration
public override IEnumerable<Vector3i> GetRelevantChunkPositions(Vector3i worldPos, Quaternion rotation)
Parameters
Type Name Description
Vector3i worldPos
Quaternion rotation
Returns
Type Description
System.Collections.Generic.IEnumerable<Vector3i>
Overrides
OccupancyContext.GetRelevantChunkPositions(Vector3i, Quaternion)

GetSurfaceUnavailablePositions(Vector3i, Quaternion)

Returns invalid positions on surface if it isn't placed on water, and also the columns of positions in case the depth check is invalid.

Declaration
public override List<Vector3i> GetSurfaceUnavailablePositions(Vector3i worldPos, Quaternion rotation)
Parameters
Type Name Description
Vector3i worldPos
Quaternion rotation
Returns
Type Description
System.Collections.Generic.List<Vector3i>
Overrides
OccupancyContext.GetSurfaceUnavailablePositions(Vector3i, Quaternion)

Extension Methods

TagUtils.TagNames(Object, Boolean)
TagUtils.TagDisplayNames(Object, Boolean)
ClientSetViewExtensions.SetClassOfProperty(Object, Player, String, String, Int32)
TypeTooltipExtensions.UILinkGeneric(Object)
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾