Show / Hide Table of Contents

Class WrappedSpace

WrappedSpace is a struct which holds information about wrapped space size and provides tools for wrapped space calculations.

Inheritance
System.Object
WrappedSpace
Namespace: Eco.Shared.Math.Wrapping
Assembly: Eco.Shared.dll
Syntax
public sealed class WrappedSpace : ValueType

Constructors

WrappedSpace(Vector3i)

Declaration
public WrappedSpace(Vector3i size)
Parameters
Type Name Description
Vector3i size

Fields

SizeXZ

Declaration
public readonly Vector2i SizeXZ
Field Value
Type Description
Vector2i

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 Description
Vector3i
Type Parameters
Name Description
T

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
Name Description
T

WrappedXZDistanceSq(Vector2, Vector2)

Calculates wrapped distance (squared) between one and other.

Declaration
public float WrappedXZDistanceSq(Vector2 one, Vector2 other)
Parameters
Type Name Description
Vector2 one
Vector2 other
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
Name Description
T

WrapX(Int32)

Declaration
public int WrapX(int x)
Parameters
Type Name Description
System.Int32 x
Returns
Type Description
System.Int32

WrapZ(Int32)

Declaration
public int WrapZ(int z)
Parameters
Type Name Description
System.Int32 z
Returns
Type Description
System.Int32

Extension Methods

CommandLine.FeedFromCommandLine(Object)
CommandLine.ToCommandLineArgs(Object, Func<Object, Boolean>)
ListUtil.DepthFirstTraversal<T>(T, Func<T, IEnumerable<T>>)
EnumerableExtensions.SingleItemAsEnumerable<T>(T)
EventUtils.RaiseEvent<TEventArgs>(Object, String, TEventArgs)
PredicateUtils.MatchesAll<TEnumerable, T>(T, TEnumerable)
PredicateUtils.MatchesAll<T>(T, Func<T, Boolean>[])
PredicateUtils.MatchesAny<TEnumerable, T>(T, TEnumerable)
ReflectionUtils.PropertyValue<T>(Object, PropertyInfo)
ReflectionUtils.TryGetPropertyValueByName<T>(Object, String, out T)
ReflectionUtils.GetPropertyValueByName<T>(Object, String)
ReflectionUtils.SetPropertyByName(Object, String, Object)
ReflectionUtils.GetStructPropertyByName<T>(Object, String)
ReflectionUtils.GetStringPropertyByName(Object, String)
ReflectionUtils.ZipByProperty<T>(Object, Object, Object, Func<T, T, T>)
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾