Table of Contents

Struct PointyRhombPoint

Namespace
Gamelogic.Grids
Assembly
Assembly-CSharp.dll

A struct that represents a point of a PointyRhombPoint.

[Version(1, 0, 0)]
[Serializable]
public struct PointyRhombPoint : IEdge<PointyHexPoint>, IEdge<FlatTriPoint>, ISplicedPoint<PointyRhombPoint, PointyHexPoint>, IGridPoint<PointyRhombPoint>, IEquatable<PointyRhombPoint>, IGridPoint, ISplicedVectorPoint<PointyRhombPoint, PointyHexPoint>
Implements
Inherited Members
Extension Methods

Constructors

PointyRhombPoint(int, int, int)

public PointyRhombPoint(int x, int y, int index)

Parameters

x int
y int
index int

Fields

HexEdgeFaceDirections

public static readonly IList<IEnumerable<PointyHexPoint>> HexEdgeFaceDirections

Field Value

IList<IEnumerable<PointyHexPoint>>

MainDirections

public static readonly IEnumerable<PointyRhombPoint>[] MainDirections

Field Value

IEnumerable<PointyRhombPoint>[]

SpliceCount

public const int SpliceCount = 3

Field Value

int

TriEdgeFaceDirections

public static readonly List<IEnumerable<FlatTriPoint>> TriEdgeFaceDirections

Field Value

List<IEnumerable<FlatTriPoint>>

Zero

public static readonly PointyRhombPoint Zero

Field Value

PointyRhombPoint

Properties

BasePoint

Why is this public? - Convenience - Algorithm Design Otherwise the user will just make a new basepoint in any case, and perhaps make a mistake.

public PointyHexPoint BasePoint { get; }

Property Value

PointyHexPoint

I

Returns the splice idnex for this point.

public int I { get; }

Property Value

int

SpliceIndex

For spliced grids, this is the index of the splice.

For Uniform grids, this is always 0.

public int SpliceIndex { get; }

Property Value

int

X

Returns the X-coordinate of this point.

public int X { get; }

Property Value

int

Y

Returns the Y-coordinate of this point.

public int Y { get; }

Property Value

int

Methods

DecIndex(int)

public PointyRhombPoint DecIndex(int n)

Parameters

n int

Returns

PointyRhombPoint

DistanceFrom(PointyRhombPoint)

The lattice distance between two points.

Two points should have a distance of 1 if and only if they are neighbors.

public int DistanceFrom(PointyRhombPoint other)

Parameters

other PointyRhombPoint

Returns

int

Equals(PointyRhombPoint)

public bool Equals(PointyRhombPoint other)

Parameters

other PointyRhombPoint

Returns

bool

Equals(object)

public override bool Equals(object other)

Parameters

other object

Returns

bool

GetColor(int, int, int)

Gives a coloring of the grid such that if a point p has color k, then all points p + m[ux, 0 | 0] + n[vx, vy | 0] have the same color for any integers a and b.

Since version 1.7

public int GetColor(int ux, int vx, int vy)

Parameters

ux int
vx int
vy int

Returns

int

GetColor12()

public int GetColor12()

Returns

int

GetHashCode()

public override int GetHashCode()

Returns

int

IncIndex(int)

public PointyRhombPoint IncIndex(int n)

Parameters

n int

Returns

PointyRhombPoint

InvertIndex()

public PointyRhombPoint InvertIndex()

Returns

PointyRhombPoint

MoveBackBy(PointyRhombPoint)

If a spliced vectors u and v has base vector B and index I

public PointyRhombPoint MoveBackBy(PointyRhombPoint other)

Parameters

other PointyRhombPoint

Returns

PointyRhombPoint

Remarks

new SplicedVector(u.B.Subtract(v.B), (SpliceCount + u.I - v.I) % SpliceCount))

MoveBy(PointyRhombPoint)

If a spliced vectors u and v has base vector B and index I,

public PointyRhombPoint MoveBy(PointyRhombPoint other)

Parameters

other PointyRhombPoint

Returns

PointyRhombPoint

Remarks

This operation is the same as

new SplicedVector(u.B.Translate(v.B), (u.I + v.I) % SpliceCount))

Negate()

Returns a new point with the vector component negated.

public PointyRhombPoint Negate()

Returns

PointyRhombPoint

ScaleDown(int)

public PointyRhombPoint ScaleDown(int r)

Parameters

r int

Returns

PointyRhombPoint

ScaleUp(int)

public PointyRhombPoint ScaleUp(int r)

Parameters

r int

Returns

PointyRhombPoint

Subtract(PointyHexPoint)

Translates this point by the negation of the given vector.

public PointyRhombPoint Subtract(PointyHexPoint other)

Parameters

other PointyHexPoint

Returns

PointyRhombPoint

ToString()

public override string ToString()

Returns

string

Translate(PointyHexPoint)

Translate this point by the given vector.

public PointyRhombPoint Translate(PointyHexPoint other)

Parameters

other PointyHexPoint

Returns

PointyRhombPoint

Operators

operator +(PointyRhombPoint, PointyHexPoint)

public static PointyRhombPoint operator +(PointyRhombPoint point1, PointyHexPoint point2)

Parameters

point1 PointyRhombPoint
point2 PointyHexPoint

Returns

PointyRhombPoint

operator /(PointyRhombPoint, int)

public static PointyRhombPoint operator /(PointyRhombPoint point, int n)

Parameters

point PointyRhombPoint
n int

Returns

PointyRhombPoint

operator ==(PointyRhombPoint, PointyRhombPoint)

public static bool operator ==(PointyRhombPoint point1, PointyRhombPoint point2)

Parameters

point1 PointyRhombPoint
point2 PointyRhombPoint

Returns

bool

operator !=(PointyRhombPoint, PointyRhombPoint)

public static bool operator !=(PointyRhombPoint point1, PointyRhombPoint point2)

Parameters

point1 PointyRhombPoint
point2 PointyRhombPoint

Returns

bool

operator *(PointyRhombPoint, int)

public static PointyRhombPoint operator *(PointyRhombPoint point, int n)

Parameters

point PointyRhombPoint
n int

Returns

PointyRhombPoint

operator -(PointyRhombPoint, PointyHexPoint)

public static PointyRhombPoint operator -(PointyRhombPoint point1, PointyHexPoint point2)

Parameters

point1 PointyRhombPoint
point2 PointyHexPoint

Returns

PointyRhombPoint

operator -(PointyRhombPoint)

public static PointyRhombPoint operator -(PointyRhombPoint point)

Parameters

point PointyRhombPoint

Returns

PointyRhombPoint

operator +(PointyRhombPoint)

public static PointyRhombPoint operator +(PointyRhombPoint point)

Parameters

point PointyRhombPoint

Returns

PointyRhombPoint