示例#1
0
文件: HexTests.cs 项目: vfridell/Gipf
        public void AxisAlignedList()
        {
            Hex[] hexes1 =
            {
                new Hex(0,  0,  0),
                new Hex(-1, 0,  1),
                new Hex(-4, 0,  4),
                new Hex(5,  0, -5),
            };
            Assert.IsTrue(Hex.AxisAligned(hexes1, Position.topright));

            Hex[] hexes2 =
            {
                new Hex(0,  0,  0),
                new Hex(-1, 0,  1),
                new Hex(0,  1, -1),
                new Hex(-4, 0,  4),
                new Hex(5,  0, -5),
            };
            Assert.IsFalse(Hex.AxisAligned(hexes2, Position.topright));

            Hex[] hexes3 =
            {
                new Hex(-3,  2,  1),
                new Hex(-3,  5, -2),
                new Hex(-3,  0,  3),
                new Hex(-2, -3,  5),
            };
            Assert.IsFalse(Hex.AxisAligned(hexes3, Position.bottomright));
        }
示例#2
0
文件: HexTests.cs 项目: vfridell/Gipf
        public void AxisAligned()
        {
            Hex to   = new Hex(2, 0, -2);
            Hex from = new Hex(-1, -3, 4);

            Assert.IsFalse(Hex.AxisAligned(from, to));

            Hex to2   = new Hex(3, -3, 0);
            Hex from2 = new Hex(-1, -3, 4);

            Assert.IsTrue(Hex.AxisAligned(from2, to2));
        }