本文整理汇总了C#中Coordinate.getX方法的典型用法代码示例。如果您正苦于以下问题:C# Coordinate.getX方法的具体用法?C# Coordinate.getX怎么用?C# Coordinate.getX使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Coordinate
的用法示例。
在下文中一共展示了Coordinate.getX方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: equals
public bool equals (Coordinate coord)
{
bool res = false;
if (x == coord.getX () && y == coord.getY ()) {
res = true;
}
return res;
}
示例2: TileScript
public TileScript (Coordinate coordinate, string type)
{
this.type = type;
this.name = coordinate.getX () + " - " + coordinate.getY ();
this.coordinates = coordinate;
this.exit1 = 0;
this.exit2 = 0;
}
示例3: getCoordinateFromExit
//Get the coordinates of the next tile given the previous tile coordinates and it's exit.
public Coordinate getCoordinateFromExit (Coordinate currentCoordinate, int exit)
{
Coordinate res = new Coordinate ();
int extra = oneIfEven (currentCoordinate.getY ());
switch (exit) {
case 1:
res.setX (currentCoordinate.getX () - extra);
res.setY (currentCoordinate.getY () - 1);
break;
case 2:
res.setX (currentCoordinate.getX () + 1 - extra);
res.setY (currentCoordinate.getY () - 1);
break;
case 3:
res.setX (currentCoordinate.getX () + 1);
res.setY (currentCoordinate.getY ());
break;
case 4:
res.setX (currentCoordinate.getX () + 1 - extra);
res.setY (currentCoordinate.getY () + 1);
break;
case 5:
res.setX (currentCoordinate.getX () - extra);
res.setY (currentCoordinate.getY () + 1);
break;
case 6:
res.setX (currentCoordinate.getX () - 1);
res.setY (currentCoordinate.getY ());
break;
}
return res;
}
示例4: placeUnused
//Checking if the tile about to place a tile is free or not.
public bool placeUnused (Coordinate coordinate, List<TileScript> tiles)
{
bool res = true;
foreach (TileScript tile in tiles) {
if (coordinate.getX () == tile.getCoordinates ().getX () && coordinate.getY () == tile.getCoordinates ().getY ()) {
res = false;
}
}
return res;
}
示例5: isOnBounds
//Checking if the coordinate of a tile to be placed is inside the map's grid or not.
public bool isOnBounds (Coordinate coordinate)
{
bool res = true;
int extra = oneIfEven (coordinate.getY ());
if (coordinate.getY () < floorY || coordinate.getY () > ceilY || coordinate.getX () < floorX || coordinate.getX () > ceilX + extra) {
res = false;
}
return res;
}