示例#1
0
        public void Back()
        {
            int i = _history.Back(_currentParagraph.Id);

            if (i != -1)
            {
                _currentParagraph = _book[i];
                CurrentParagraphChanged?.Invoke(this, new EventArgs());
            }
        }
示例#2
0
 public void SetNewBook(IBook book, IHistory history)
 {
     if (history != null & book != null)
     {
         _book             = book;
         _history          = history;
         _currentParagraph = _book[_history.GetCurrentParagraphId];
     }
     CurrentParagraphChanged?.Invoke(this, new EventArgs());
 }
示例#3
0
        public void Next(string answer)
        {
            int i = _currentParagraph.NextParagraphId(answer);

            if (i >= 0)
            {
                _history.AddInAlreadyRead(_currentParagraph.Id);
                _history.AddInHistory(i);
                _currentParagraph = _book[i];
                CurrentParagraphChanged?.Invoke(this, new EventArgs());
            }
        }
示例#4
0
 public void Reset()
 {
     _history.Reset();
     _currentParagraph = _book[0];
     CurrentParagraphChanged?.Invoke(this, new EventArgs());
 }
示例#5
0
 public void GoTo(int id)
 {
     _currentParagraph = _book[_history.GoTo(id)];
     CurrentParagraphChanged?.Invoke(this, new EventArgs());
 }