Class WrappedSpace
WrappedSpace is a struct which holds information about wrapped space size and provides tools for wrapped space calculations.
Inheritance
System.Object
WrappedSpace
Assembly: Eco.Shared.dll
Syntax
public sealed class WrappedSpace : ValueType
Constructors
WrappedSpace(Vector3i)
Declaration
public WrappedSpace(Vector3i size)
Parameters
Fields
SizeXZ
Declaration
public readonly Vector2i SizeXZ
Field Value
SizeY
Declaration
public readonly int SizeY
Field Value
Type |
Description |
System.Int32 |
|
Properties
SizeX
Declaration
public int SizeX { get; }
Property Value
Type |
Description |
System.Int32 |
|
SizeZ
Declaration
public int SizeZ { get; }
Property Value
Type |
Description |
System.Int32 |
|
Methods
WrappedDifference<T>(T, T)
Calculates wrapped difference between a
and b
.
I.e. for world size (100, 100, 80):
- (10, 10, 10).WrappedDelta(20, 20, 20) -> (-10, -10, -10)
- (10, 10, 10).WrappedDelta(60, 20, 60) -> (-50, -10, -30)
- (10, 10, 10).WrappedDelta(60, 20, 60) -> (-50, -10, -50)
Declaration
public Vector3i WrappedDifference<T>(T a, T b)
where T : IWrappedPosition3<int>
Parameters
Type |
Name |
Description |
T |
a |
|
T |
b |
|
Returns
Type Parameters
WrappedXZDistance<T>(T, T)
Calculates wrapped distance between a
and b
.
Declaration
public float WrappedXZDistance<T>(T a, T b)
where T : IWrappedPosition3<int>
Parameters
Type |
Name |
Description |
T |
a |
|
T |
b |
|
Returns
Type |
Description |
System.Single |
|
Type Parameters
WrappedXZDistanceSq(Vector2, Vector2)
Calculates wrapped distance (squared) between one
and other
.
Declaration
public float WrappedXZDistanceSq(Vector2 one, Vector2 other)
Parameters
Returns
Type |
Description |
System.Single |
|
WrappedXZDistanceSq<T>(T, T)
Calculates wrapped distance (squared) between a
and b
.
Declaration
public int WrappedXZDistanceSq<T>(T a, T b)
where T : IWrappedPosition3<int>
Parameters
Type |
Name |
Description |
T |
a |
|
T |
b |
|
Returns
Type |
Description |
System.Int32 |
|
Type Parameters
WrapX(Int32)
Declaration
Parameters
Type |
Name |
Description |
System.Int32 |
x |
|
Returns
Type |
Description |
System.Int32 |
|
WrapZ(Int32)
Declaration
Parameters
Type |
Name |
Description |
System.Int32 |
z |
|
Returns
Type |
Description |
System.Int32 |
|
Extension Methods