示例#1
0
def test_axial_neighbors():
    c = coord.Axial(5, 5)
    n = list(c.neighbors())
    assert len(n) == 6
    assert coord.Axial(6, 5) in n
    assert coord.Axial(6, 4) in n
    assert coord.Axial(5, 4) in n
    assert coord.Axial(4, 5) in n
    assert coord.Axial(4, 6) in n
    assert coord.Axial(5, 4) in n
示例#2
0
def test_axis_to_cube():
    assert coord.Axial(1, -3).to_cube() == coord.Cube(1, 2, -3)
    assert coord.Axial(-2, 5).to_cube() == coord.Cube(-2, -3, 5)
示例#3
0
def test_iterable_axial():
    c = coord.Axial(3, 5)
    q, r = c
    assert (c.q, c.r) == (q, r)
示例#4
0
def test_axial_getters():
    c = coord.Axial(1, -1)
    assert c.q == 1
    assert c.r == -1