当前位置: 首页>>代码示例>>C#>>正文


C# Coordinate.getY方法代码示例

本文整理汇总了C#中Coordinate.getY方法的典型用法代码示例。如果您正苦于以下问题:C# Coordinate.getY方法的具体用法?C# Coordinate.getY怎么用?C# Coordinate.getY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Coordinate的用法示例。


在下文中一共展示了Coordinate.getY方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: equals

		public bool equals (Coordinate coord)
		{
				bool res = false;
		
				if (x == coord.getX () && y == coord.getY ()) {
						res = true;
		
				}
				return res;
		
		}
开发者ID:PabloA-C,项目名称:HexPuzzle,代码行数:11,代码来源:Coordinate.cs

示例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;
			
		}
开发者ID:PabloA-C,项目名称:HexPuzzle,代码行数:12,代码来源:TileScript.cs

示例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;
		
		
		}
开发者ID:PabloA-C,项目名称:HexPuzzle,代码行数:38,代码来源:AuxMethods.cs

示例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;
		
		}
开发者ID:PabloA-C,项目名称:HexPuzzle,代码行数:17,代码来源:AuxMethods.cs

示例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;
		}
开发者ID:PabloA-C,项目名称:HexPuzzle,代码行数:19,代码来源:AuxMethods.cs


注:本文中的Coordinate.getY方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。