Struct Coordinate
Coordinate struct
Namespace
Syntax
public struct Coordinate
Constructors
Coordinate(int, int)
Makes a new coordinate instance
Declaration
public Coordinate(int x, int y)
Parameters
| Name | Type | Description |
|---|---|---|
| x | int | A zero-based X coordinate |
| y | int | A zero-based Y coordinate |
Properties
X
Gets the X position
Property Value
int
Declaration
public readonly int X { get; }
Y
Gets the Y position
Property Value
int
Declaration
public readonly int Y { get; }
Methods
Equals(object?)
Returns
bool
Declaration
public override bool Equals(object? obj)
Parameters
| Name | Type | Description |
|---|---|---|
| obj | object |
Overrides
System.ValueType.Equals(object)
Equals(Coordinate)
Returns
bool
Declaration
public bool Equals(Coordinate other)
Parameters
| Name | Type | Description |
|---|---|---|
| other | Coordinate |
GetHashCode()
Returns
int
Declaration
public override int GetHashCode()
Overrides
System.ValueType.GetHashCode()
ToString()
Generates a string containing positions
Returns
string
X and Y coordinates in a string
Declaration
public override string ToString()
Overrides
System.ValueType.ToString()
Operators
operator ==(Coordinate, Coordinate)
Returns
bool
Declaration
public static bool operator ==(Coordinate left, Coordinate right)
Parameters
| Name | Type | Description |
|---|---|---|
| left | Coordinate | |
| right | Coordinate |
operator !=(Coordinate, Coordinate)
Returns
bool
Declaration
public static bool operator !=(Coordinate left, Coordinate right)
Parameters
| Name | Type | Description |
|---|---|---|
| left | Coordinate | |
| right | Coordinate |