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
WaterDepthContext
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
Returns
Type |
Description |
System.Boolean |
|
Overrides
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
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<Vector3i> |
|
Overrides
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
Returns
Type |
Description |
System.Collections.Generic.List<Vector3i> |
|
Overrides
Extension Methods