コード例 #1
0
ファイル: FloorPlanTest.cs プロジェクト: ejbelt/RogueElements
        public void GetAdjacentRoomsOneHall()
        {
            // only hall adjacent
            // A-a-b
            TestFloorPlan floorPlan = TestFloorPlan.InitFloorToContext(
                new Loc(22, 14),
                new Rect[] { Rect.Empty },
                new Rect[] { Rect.Empty, Rect.Empty },
                new Tuple <char, char>[] { Tuple.Create('A', 'a'), Tuple.Create('a', 'b') });

            List <int> adjacentRooms = floorPlan.GetAdjacentRooms(0);
            List <int> expectedRooms = new List <int>();

            Assert.That(adjacentRooms, Is.EqualTo(expectedRooms));
        }
コード例 #2
0
ファイル: FloorPlanTest.cs プロジェクト: ejbelt/RogueElements
        public void GetAdjacentRoomsNone()
        {
            // no adjacents
            // A B a
            TestFloorPlan floorPlan = TestFloorPlan.InitFloorToContext(
                new Loc(22, 14),
                new Rect[] { Rect.Empty, Rect.Empty },
                new Rect[] { Rect.Empty },
                Array.Empty <Tuple <char, char> >());

            List <int> adjacentRooms = floorPlan.GetAdjacentRooms(0);
            List <int> expectedRooms = new List <int>();

            Assert.That(adjacentRooms, Is.EqualTo(expectedRooms));
        }
コード例 #3
0
ファイル: FloorPlanTest.cs プロジェクト: ejbelt/RogueElements
        public void GetAdjacentRoomsRoomsFromHall()
        {
            // only hall adjacent, leading to rooms

            /* A-a-b-B
             |
             |     C   */
            TestFloorPlan floorPlan = TestFloorPlan.InitFloorToContext(
                new Loc(22, 14),
                new Rect[] { Rect.Empty, Rect.Empty, Rect.Empty },
                new Rect[] { Rect.Empty, Rect.Empty },
                new Tuple <char, char>[] { Tuple.Create('A', 'a'), Tuple.Create('B', 'b'), Tuple.Create('C', 'b'), Tuple.Create('a', 'b') });

            List <int> adjacentRooms = floorPlan.GetAdjacentRooms(0);
            var        expectedRooms = new List <int> {
                1, 2
            };

            Assert.That(adjacentRooms, Is.EqualTo(expectedRooms));
        }
コード例 #4
0
ファイル: FloorPlanTest.cs プロジェクト: ejbelt/RogueElements
        public void GetAdjacentRoomsRooms()
        {
            // rooms adjacent (and one room after)

            /* A-B-D
            |
            |  C     */
            TestFloorPlan floorPlan = TestFloorPlan.InitFloorToContext(
                new Loc(22, 14),
                new Rect[] { Rect.Empty, Rect.Empty, Rect.Empty },
                Array.Empty <Rect>(),
                new Tuple <char, char>[] { Tuple.Create('A', 'B'), Tuple.Create('A', 'C'), Tuple.Create('B', 'C') });

            List <int> adjacentRooms = floorPlan.GetAdjacentRooms(0);
            var        expectedRooms = new List <int> {
                1, 2
            };

            Assert.That(adjacentRooms, Is.EqualTo(expectedRooms));
        }