示例#1
0
    static public void TestOffsetRoundtrip()
    {
        HexTile a = new HexTile(3, 4, -7);
        OsCoord b = new OsCoord(1, -3);

        EqualHex("conversion_roundtrip even-r", a, OsCoord.RoffsetToCube(OsCoord.EVEN, OsCoord.RoffsetFromCube(OsCoord.EVEN, a)));
        EqualOffsetcoord("conversion_roundtrip even-r", b, OsCoord.RoffsetFromCube(OsCoord.EVEN, OsCoord.RoffsetToCube(OsCoord.EVEN, b)));

        EqualHex("conversion_roundtrip odd-r", a, OsCoord.RoffsetToCube(OsCoord.ODD, OsCoord.RoffsetFromCube(OsCoord.ODD, a)));
        EqualOffsetcoord("conversion_roundtrip odd-r", b, OsCoord.RoffsetFromCube(OsCoord.ODD, OsCoord.RoffsetToCube(OsCoord.ODD, b)));
    }
示例#2
0
 static public void TestOffsetFromCube()
 {
     EqualOffsetcoord("offset_from_cube odd-r", new OsCoord(1, 2), OsCoord.RoffsetFromCube(OsCoord.ODD, new HexTile(1, 2, -3)));
 }