Show / Hide Table of Contents

Class PlotUtil

Functions for translating to/from property plot coordinates.

Inheritance
System.Object
PlotUtil
Namespace: Eco.Shared.Voxel
Assembly: Eco.Shared.dll
Syntax
public static class PlotUtil : Object

Fields

PlotSize

Declaration
public const int PlotSize = 5
Field Value
Type Description
System.Int32

PropertyPlotArea

Declaration
public const int PropertyPlotArea = 25
Field Value
Type Description
System.Int32

PropertyPlotLength

Declaration
public const int PropertyPlotLength = 5
Field Value
Type Description
System.Int32

Properties

WorldPlotDims

Returns many plots exist in the x and z dimensions of the world.

Declaration
public static Vector2i WorldPlotDims { get; }
Property Value
Type Description
Vector2i

Methods

CornerOfCurrentPlot(Vector3i)

Return the corner of whatever plot the position currently is in.

Declaration
public static Vector3i CornerOfCurrentPlot(this Vector3i pos)
Parameters
Type Name Description
Vector3i pos
Returns
Type Description
Vector3i

Corners(PlotPos)

Declaration
public static IEnumerable<Vector2i> Corners(this PlotPos pos)
Parameters
Type Name Description
PlotPos pos
Returns
Type Description
System.Collections.Generic.IEnumerable<Vector2i>

IntersectingPlotsExc(WorldRange)

Get the list of Plot Positions for each plot that this range intersects.

Declaration
public static IEnumerable<PlotPos> IntersectingPlotsExc(this WorldRange range)
Parameters
Type Name Description
WorldRange range
Returns
Type Description
System.Collections.Generic.IEnumerable<PlotPos>

IntersectingPlotsInc(WorldRange)

Declaration
public static IEnumerable<PlotPos> IntersectingPlotsInc(this WorldRange range)
Parameters
Type Name Description
WorldRange range
Returns
Type Description
System.Collections.Generic.IEnumerable<PlotPos>

RawPlotPos(Vector2i)

Converts a Vector2i to a plotpos structure, with no coordinate transformation at all. Careful with this one. Asserts its pre-wrapped.

Declaration
public static PlotPos RawPlotPos(this Vector2i worldPos)
Parameters
Type Name Description
Vector2i worldPos
Returns
Type Description
PlotPos

RawPlotPosWrap(Vector2i)

Converts the raw value of a vector2i already in plot space to a plot pos, wrapping in the process. Needed to work with things that iterate on vector2is past world bounds, like WorldRange.

Declaration
public static PlotPos RawPlotPosWrap(this Vector2i vectorInPlotSpace)
Parameters
Type Name Description
Vector2i vectorInPlotSpace
Returns
Type Description
PlotPos

ToPlotPos(Vector2i)

Converts a position in world space to a position in plot space. Performs the wrap.

Declaration
public static PlotPos ToPlotPos(this Vector2i worldPos)
Parameters
Type Name Description
Vector2i worldPos
Returns
Type Description
PlotPos

ToPlotPos(Vector3i)

Converts a position in world space to a position in plot space. Performs the wrap. Ignores 'y' value.

Declaration
public static PlotPos ToPlotPos(this Vector3i worldPos)
Parameters
Type Name Description
Vector3i worldPos
Returns
Type Description
PlotPos
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾