Show / Hide Table of Contents

Struct ChunkCoords

Represents the coordinates of a chunk in the grid.

Implements
IEquatable<ChunkCoords>
Inherited Members
ValueType.Equals(object)
ValueType.GetHashCode()
object.Equals(object, object)
object.GetType()
object.ReferenceEquals(object, object)
Namespace: TerraProc.Core.Terrain
Assembly: TerraProc.Core.dll
Syntax
public readonly record struct ChunkCoords : IEquatable<ChunkCoords>

Constructors

| Edit this page View Source

ChunkCoords(int, int)

Represents the coordinates of a chunk in the grid.

Declaration
public ChunkCoords(int X, int Y)
Parameters
Type Name Description
int X

X coordinate of the chunk.

int Y

Y coordinate of the chunk.

Properties

| Edit this page View Source

X

X coordinate of the chunk.

Declaration
public int X { get; init; }
Property Value
Type Description
int
| Edit this page View Source

Y

Y coordinate of the chunk.

Declaration
public int Y { get; init; }
Property Value
Type Description
int

Methods

| Edit this page View Source

Deconstruct(out int, out int)

Deconstructs the chunk coordinates into individual X and Y components.

Declaration
public void Deconstruct(out int x, out int y)
Parameters
Type Name Description
int x

X coordinate.

int y

Y coordinate.

| Edit this page View Source

ToString()

String representation of the chunk coordinates.

Declaration
public override string ToString()
Returns
Type Description
string

String in the format "ChunkCoords(X, Y)".

Overrides
ValueType.ToString()
| Edit this page View Source

ToTileCoords()

Converts the chunk coordinates to global tile coordinates by multiplying with ChunkSize.

Declaration
public TileCoords ToTileCoords()
Returns
Type Description
TileCoords

Corresponding global tile coordinates.

Operators

| Edit this page View Source

operator +(ChunkCoords, ChunkCoords)

Addition operator for chunk coordinates.

Declaration
public static ChunkCoords operator +(ChunkCoords a, ChunkCoords b)
Parameters
Type Name Description
ChunkCoords a

First operand.

ChunkCoords b

Second operand.

Returns
Type Description
ChunkCoords

Sum of the two chunk coordinates.

| Edit this page View Source

explicit operator ChunkCoords((int x, int y))

Explicit conversion from tuple.

Declaration
public static explicit operator ChunkCoords((int x, int y) tuple)
Parameters
Type Name Description
(int x, int y) tuple

Tuple containing the X and Y coordinates.

Returns
Type Description
ChunkCoords

Chunk coordinates.

| Edit this page View Source

implicit operator (int x, int y)(ChunkCoords)

Implicit conversion to tuple.

Declaration
public static implicit operator (int x, int y)(ChunkCoords cc)
Parameters
Type Name Description
ChunkCoords cc

Chunk coordinates.

Returns
Type Description
(int x, int y)

Tuple containing the X and Y coordinates.

| Edit this page View Source

operator -(ChunkCoords, ChunkCoords)

Subtraction operator for chunk coordinates.

Declaration
public static ChunkCoords operator -(ChunkCoords a, ChunkCoords b)
Parameters
Type Name Description
ChunkCoords a

First operand.

ChunkCoords b

Second operand.

Returns
Type Description
ChunkCoords

Difference of the two chunk coordinates.

Implements

IEquatable<T>
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX