public void Back() { int i = _history.Back(_currentParagraph.Id); if (i != -1) { _currentParagraph = _book[i]; CurrentParagraphChanged?.Invoke(this, new EventArgs()); } }
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()); }
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()); } }
public void Reset() { _history.Reset(); _currentParagraph = _book[0]; CurrentParagraphChanged?.Invoke(this, new EventArgs()); }
public void GoTo(int id) { _currentParagraph = _book[_history.GoTo(id)]; CurrentParagraphChanged?.Invoke(this, new EventArgs()); }