aboutsummaryrefslogtreecommitdiff
path: root/src/model
diff options
context:
space:
mode:
Diffstat (limited to 'src/model')
-rw-r--r--src/model/card.rs8
-rw-r--r--src/model/deck.rs5
-rw-r--r--src/model/difficulty.rs16
-rw-r--r--src/model/mod.rs3
4 files changed, 32 insertions, 0 deletions
diff --git a/src/model/card.rs b/src/model/card.rs
new file mode 100644
index 0000000..3ac395e
--- /dev/null
+++ b/src/model/card.rs
@@ -0,0 +1,8 @@
+use crate::space_repetition;
+
+#[derive(Debug)]
+pub struct Card {
+ pub question: String,
+ pub responses: Vec<String>,
+ pub state: space_repetition::State,
+}
diff --git a/src/model/deck.rs b/src/model/deck.rs
new file mode 100644
index 0000000..769b38c
--- /dev/null
+++ b/src/model/deck.rs
@@ -0,0 +1,5 @@
+#[derive(Debug, Clone)]
+pub struct Entry {
+ pub part_1: Vec<String>,
+ pub part_2: Vec<String>,
+}
diff --git a/src/model/difficulty.rs b/src/model/difficulty.rs
new file mode 100644
index 0000000..ea5a9ce
--- /dev/null
+++ b/src/model/difficulty.rs
@@ -0,0 +1,16 @@
+#[derive(Debug, Clone, Copy, PartialEq)]
+pub enum Difficulty {
+ Again,
+ Hard,
+ Good,
+ Easy,
+}
+
+pub fn label(difficulty: Difficulty) -> String {
+ match difficulty {
+ Difficulty::Again => "Recommencer".to_string(),
+ Difficulty::Hard => "Difficile".to_string(),
+ Difficulty::Good => "Bon".to_string(),
+ Difficulty::Easy => "Facile".to_string(),
+ }
+}
diff --git a/src/model/mod.rs b/src/model/mod.rs
new file mode 100644
index 0000000..bbd7891
--- /dev/null
+++ b/src/model/mod.rs
@@ -0,0 +1,3 @@
+pub mod card;
+pub mod deck;
+pub mod difficulty;