Implemented choices successfully

This commit is contained in:
2026-05-10 23:19:42 +01:00
parent 7e5874ffbb
commit fbd315ed7b
5 changed files with 85 additions and 79 deletions
+1 -28
View File
@@ -29,40 +29,13 @@ pub struct Character
bottom_clothing: String,
shoes: String,
}
impl Character
{
pub fn new(new_name: String) -> Character
{
Character
{
name: new_name,
gender: "".to_string(),
eye_color: "".to_string(),
pronoun_subject: "".to_string(),
pronoun_object: "".to_string(),
pronoun_deppos: "".to_string(),
pronoun_indpos: "".to_string(),
pronoun_reflex: "".to_string(),
animation: "".to_string(),
head: "".to_string(),
hair: "".to_string(),
torso: "".to_string(),
arm: "".to_string(),
leg: "".to_string(),
hair_color: "".to_string(),
top_clothing: "".to_string(),
bottom_clothing: "".to_string(),
shoes: "".to_string(),
}
}
}
pub async fn character_parse()
-> Result<Arc<Mutex<HashMap<String, Character>>>,String>
{
// Get the JSON file to a string
let file_contents: String = fs::read_to_string("stories/characters.json")
.unwrap_or_else(|err| { return err.to_string() });
.unwrap_or_else(|err| { err.to_string() });
// Serialise this to a HashMap
let characters: HashMap<String, Character> =