added CHANGE command

This commit is contained in:
2026-05-14 21:24:28 +01:00
parent a55053dc97
commit a18928c673
11 changed files with 82 additions and 11 deletions
+28
View File
@@ -31,6 +31,34 @@ pub struct Character
bottom_clothing: String,
shoes: String,
}
impl Character {
pub fn set_field(&mut self, field: &str, value: &str) -> Result<(), ()> {
match field {
"name" => self.name = value.to_string(),
"gender" => self.gender = value.to_string(),
"eye_color" => self.eye_color = value.to_string(),
"pronoun_subject" => self.pronoun_subject = value.to_string(),
"pronoun_object" => self.pronoun_object = value.to_string(),
"pronoun_deppos" => self.pronoun_deppos = value.to_string(),
"pronoun_indpos" => self.pronoun_indpos = value.to_string(),
"pronoun_reflex" => self.pronoun_reflex = value.to_string(),
"animation" => self.animation = value.to_string(),
"head" => self.head = value.to_string(),
"hair" => self.hair = value.to_string(),
"torso" => self.torso = value.to_string(),
"arm" => self.arm = value.to_string(),
"leg" => self.leg = value.to_string(),
"hair_color" => self.hair_color = value.to_string(),
"top_clothing" => self.top_clothing = value.to_string(),
"bottom_clothing" => self.bottom_clothing = value.to_string(),
"shoes" => self.shoes = value.to_string(),
_ => return Err(()),
}
Ok(())
}
}
pub fn character_parse(archive: &mut ZipArchive<File>)
-> Result<Arc<Mutex<HashMap<String, Character>>>,String>