internal void SetIndices(BookBlockIndices indices)
 {
     m_currentBookIndex  = indices.BookIndex;
     m_currentBook       = m_books[m_currentBookIndex];
     m_currentBlockIndex = indices.BlockIndex;
     m_currentBlock      = m_currentBook.GetScriptBlocks()[m_currentBlockIndex];
 }
        public Block PeekNthPreviousBlockWithinBook(int n, Block baseLineBlock)
        {
            if (baseLineBlock == m_currentBlock)
            {
                return(PeekNthPreviousBlockWithinBook(n));
            }
            BookBlockIndices indices = GetIndicesOfSpecificBlock(baseLineBlock);

            return(PeekNthPreviousBlockWithinBook(n, indices.BookIndex, indices.BlockIndex));
        }
Beispiel #3
0
 public BlockNavigator(IReadOnlyList <BookScript> books)
 {
     m_books       = books;
     m_currentBook = m_books.FirstOrDefault(b => b.HasScriptBlocks);
     if (m_currentBook == null)
     {
         throw new ArgumentException("The list of books must contain at least one block.");
     }
     m_currentIndices = new BookBlockIndices(0, 0);
 }