diff options
Diffstat (limited to 'built_res')
| -rw-r--r-- | built_res/Cargo.toml | 6 | ||||
| -rw-r--r-- | built_res/src/lib.rs | 2 | ||||
| -rw-r--r-- | built_res/src/res_sentences.rs | 51 | ||||
| -rw-r--r-- | built_res/src/structs.rs | 1 | ||||
| -rw-r--r-- | built_res/src/structs/sentence.rs | 12 |
5 files changed, 72 insertions, 0 deletions
diff --git a/built_res/Cargo.toml b/built_res/Cargo.toml new file mode 100644 index 0000000..b88a569 --- /dev/null +++ b/built_res/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "built_res" +workspaces.version = true +edition = "2024" + +[dependencies] diff --git a/built_res/src/lib.rs b/built_res/src/lib.rs new file mode 100644 index 0000000..bef5b44 --- /dev/null +++ b/built_res/src/lib.rs @@ -0,0 +1,2 @@ +pub mod res_sentences; +pub mod structs; diff --git a/built_res/src/res_sentences.rs b/built_res/src/res_sentences.rs new file mode 100644 index 0000000..8354ded --- /dev/null +++ b/built_res/src/res_sentences.rs @@ -0,0 +1,51 @@ +use crate::structs::sentence::{Sentence, Token}; + +#[derive(Hash, PartialEq, Eq)] +pub enum SentenceId { + // 在此处确认所有跳转点 + Main0, + Main1, + Main2, + Ok1, +} + +pub fn get_sentence(id: SentenceId) -> Option<Sentence<'static>> { + match id { + SentenceId::Main0 => Some(Sentence { + content_tokens: &[ + &Token::Text("你好我是"), + &Token::Command("red"), + &Token::Text("猫尾草"), + &Token::Command("/"), + ], + next_sentence: Some(SentenceId::Main1), + }), + SentenceId::Main1 => Some(Sentence { + content_tokens: &[ + &Token::Text("你好我是"), + &Token::Command("red"), + &Token::Text("猫尾草"), + &Token::Command("/"), + ], + next_sentence: Some(SentenceId::Main2), + }), + SentenceId::Main2 => Some(Sentence { + content_tokens: &[ + &Token::Text("你好我是"), + &Token::Command("red"), + &Token::Text("猫尾草"), + &Token::Command("/"), + ], + next_sentence: Some(SentenceId::Ok1), + }), + SentenceId::Ok1 => Some(Sentence { + content_tokens: &[ + &Token::Text("你好我是"), + &Token::Command("red"), + &Token::Text("猫尾草"), + &Token::Command("/"), + ], + next_sentence: None, + }), + } +} diff --git a/built_res/src/structs.rs b/built_res/src/structs.rs new file mode 100644 index 0000000..b7bb9ef --- /dev/null +++ b/built_res/src/structs.rs @@ -0,0 +1 @@ +pub mod sentence; diff --git a/built_res/src/structs/sentence.rs b/built_res/src/structs/sentence.rs new file mode 100644 index 0000000..270d5f7 --- /dev/null +++ b/built_res/src/structs/sentence.rs @@ -0,0 +1,12 @@ +pub struct Sentence<'a> { + pub content_tokens: &'a [&'static Token], + pub next_sentence: Option<crate::res_sentences::SentenceId>, +} + +pub enum Token { + Text(&'static str), + BoldText(&'static str), + ItalicText(&'static str), + BoldItalicText(&'static str), + Command(&'static str), +} |
