XposeCraft  1.0.1-rc1
Public API for Arena Gameplay
XposeCraft.Game.Position Class Reference

Map position defined by X and Y coordinates. More...

Public Member Functions

 Position (int pointLocation)
 Create the Position representing an internal grid point location on the map. More...
 
 Position (int x, int y)
 Create the Position from X and Y coordinates. More...
 
Path PathFrom (Position position)
 Creates a Path representation between two Positions. More...
 
bool IsAvailable ()
 Describes whether the Position is available for movement or placement purposes. More...
 
Position FindNearestAvailable ()
 Finds a nearest available Position. More...
 
bool IsValidPlacement (BuildingType buildingType)
 Checks whether a Building of the chosen type can be placed on the Position. More...
 
bool IsFogUncovered ()
 Checks whether the Fog of War is uncovered on this position, making everything there visible. More...
 
override bool Equals (object obj)
 
bool Equals (Position position)
 
override int GetHashCode ()
 

Static Public Member Functions

static bool operator== (Position a, Position b)
 
static bool operator!= (Position a, Position b)
 

Properties

int X [get]
 Representing X coordinate. More...
 
int Y [get]
 Representing Y coordinate. More...
 
int PointLocation [get]
 Internal grid point location on the map. More...
 
Vector3 Location [get]
 Internal Vector3 representation. More...
 

Detailed Description

Map position defined by X and Y coordinates.

Constructor & Destructor Documentation

◆ Position() [1/2]

XposeCraft.Game.Position.Position ( int  pointLocation)

Create the Position representing an internal grid point location on the map.

Parameters
pointLocationInternal grid point location on the map.
Exceptions
ArgumentExceptionThrown when the location is out of bounds within the map.

◆ Position() [2/2]

XposeCraft.Game.Position.Position ( int  x,
int  y 
)

Create the Position from X and Y coordinates.

Parameters
xX coordinate.
yY coordinate.
Exceptions
ArgumentExceptionThrown when a coordinate is out of bounds within the map.

Member Function Documentation

◆ Equals() [1/2]

override bool XposeCraft.Game.Position.Equals ( object  obj)

◆ Equals() [2/2]

bool XposeCraft.Game.Position.Equals ( Position  position)

◆ FindNearestAvailable()

Position XposeCraft.Game.Position.FindNearestAvailable ( )

Finds a nearest available Position.

Returns
Available Position.

◆ GetHashCode()

override int XposeCraft.Game.Position.GetHashCode ( )

◆ IsAvailable()

bool XposeCraft.Game.Position.IsAvailable ( )

Describes whether the Position is available for movement or placement purposes.

Returns
True if the Position is available.

◆ IsFogUncovered()

bool XposeCraft.Game.Position.IsFogUncovered ( )

Checks whether the Fog of War is uncovered on this position, making everything there visible.

Returns
True if the Fog if uncovered.

◆ IsValidPlacement()

bool XposeCraft.Game.Position.IsValidPlacement ( BuildingType  buildingType)

Checks whether a Building of the chosen type can be placed on the Position.

The condition is also that the Fog is currently uncovered there.

Parameters
buildingTypeType of the building meant to be built.
Returns
True if the building can be placed on the Position.

◆ operator!=()

static bool XposeCraft.Game.Position.operator!= ( Position  a,
Position  b 
)
static

◆ operator==()

static bool XposeCraft.Game.Position.operator== ( Position  a,
Position  b 
)
static

◆ PathFrom()

Path XposeCraft.Game.Position.PathFrom ( Position  position)

Creates a Path representation between two Positions.

Parameters
positionPosition of the path origin.
Returns
Path between two Positions.

Property Documentation

◆ Location

Vector3 XposeCraft.Game.Position.Location
getprotected

Internal Vector3 representation.

◆ PointLocation

int XposeCraft.Game.Position.PointLocation
get

Internal grid point location on the map.

◆ X

int XposeCraft.Game.Position.X
get

Representing X coordinate.

◆ Y

int XposeCraft.Game.Position.Y
get

Representing Y coordinate.