CardStates rewritten to TableAccessQuerySet
This commit is contained in:
1 parent
45830a7985
commit
068b9c7197
7 files changed
+88
-40
No files matched your search
+3
-3
@@ -15,7 +15,7 @@ use std::sync::Arc;
|
||||
#[derive(Clone)]
|
||||
pub struct DeckData {
|
||||
pub(crate) words: Vec<WordData>,
|
||||
pub(crate) set: Vec<CardStatistics>,
|
||||
pub(crate) set: Vec<CardState>,
|
||||
current_word_index: Option<usize>,
|
||||
state: Arc<Mutex<AppState>>,
|
||||
order_module: OrderModule,
|
||||
@@ -54,7 +54,7 @@ impl DeckData {
|
||||
})
|
||||
}
|
||||
|
||||
pub fn next(&mut self) -> (WordData, CardStatistics) {
|
||||
pub fn next(&mut self) -> (WordData, CardState) {
|
||||
let index = match self.order_module {
|
||||
SemiRandomSRS(ref mut module) => {
|
||||
if !module.initialized {
|
||||
@@ -88,7 +88,7 @@ impl DeckData {
|
||||
}
|
||||
pub fn open(&mut self, status: WordOpenMode) -> MaybeError {
|
||||
if let Some(index) = self.current_word_index {
|
||||
let word: &mut CardStatistics = &mut self.set[index];
|
||||
let word: &mut CardState = &mut self.set[index];
|
||||
let old_score = word.score;
|
||||
word.update(status);
|
||||
let new_score = word.score;
|
||||
|
||||
Reference in new issue
Block a user