示例#1
0
        public void NTest_moveTowards_validMove()
        {
            Dungeon dungeon = new Dungeon(3, 8);
            Pack    pack1   = new Pack("1", 4, dungeon);

            pack1.location = dungeon.startNode;

            dungeon.startNode.packs.Add(pack1);
            Node nextNode = (dungeon.shortestpath(dungeon.startNode, dungeon.exitNode))[0];

            Logger.log("Next node will be " + nextNode.id);
            Logger.log("exitnode is " + dungeon.exitNode.id);
            pack1.MoveTowards(dungeon.exitNode);
            Assert.AreSame(nextNode.id, pack1.location.id);
        }