コード例 #1
0
    public List <Room> GetPathBetweenRooms(Room origin, Room target)
    {
        List <Room>           path     = new List <Room>();
        LinkedListNode <Room> roomNode = roomPaths.Find(origin);

        if (roomNode.GetNextNode(true).Value == target)
        {
            path.Add(target);
        }
        else if (roomNode.GetNextNode(false).Value == target)
        {
            path.Add(target);
        }
        else
        {
            path.Add(roomNode.GetNextNode(true).Value);
            path.Add(target);
        }
        return(path);
    }