コード例 #1
0
ファイル: HexMap.cs プロジェクト: Clpsplug/hexagonal_map
        /// <summary>
        /// Get cell from QR coordinates
        /// </summary>
        /// <param name="position"></param>
        /// <returns>Cell found</returns>
        /// <exception cref="ArgumentOutOfRangeException">if there's no cell in the given position</exception>
        public Cell GetCellAt(QRCoordinate position)
        {
            var positionRequested = CubeCoordinate.FromQr(position);

            var cell = GetCellAt(positionRequested);

            return(cell);
        }
コード例 #2
0
ファイル: HexMap.cs プロジェクト: Clpsplug/hexagonal_map
 /// <summary>
 /// Create QR coordinate from itself
 /// </summary>
 /// <returns>QR coordinate</returns>
 public QRCoordinate ToQr()
 {
     return(QRCoordinate.FromCube(this));
 }
コード例 #3
0
ファイル: HexMap.cs プロジェクト: Clpsplug/hexagonal_map
 /// <summary>
 /// Create a cube coordinate from a QR coodinate
 /// </summary>
 /// <param name="input">QR coordinate (as object)</param>
 /// <returns>Cube coordinate</returns>
 public static CubeCoordinate FromQr(QRCoordinate input)
 {
     return(FromQr(input.q, input.r));
 }