redesigned how file is tokenised into string, keyword, identifier, bracket and character
added support for GOTOs and removed object recursive calls
This commit is contained in:
+12
-2
@@ -17,7 +17,9 @@ pub struct Character
|
||||
{
|
||||
name: String,
|
||||
gender: String,
|
||||
eye_color: String,
|
||||
eye_color: Colour,
|
||||
hair_color: Colour,
|
||||
skin_color: Colour,
|
||||
pronoun_subject: String,
|
||||
pronoun_object: String,
|
||||
pronoun_deppos: String,
|
||||
@@ -28,7 +30,6 @@ pub struct Character
|
||||
torso_shape: String,
|
||||
arm_shape: String,
|
||||
leg_shape: String,
|
||||
hair_color: String, // TODO RGB enum
|
||||
clothing: Clothing,
|
||||
}
|
||||
#[derive(Debug,Deserialize,Serialize,Clone,Default)]
|
||||
@@ -39,6 +40,15 @@ pub struct Clothing
|
||||
bottom: String,
|
||||
shoes: String,
|
||||
}
|
||||
#[derive(Debug,Deserialize,Serialize,Clone,Default)]
|
||||
#[serde(default)]
|
||||
pub struct Colour
|
||||
{
|
||||
red: u8,
|
||||
green: u8,
|
||||
blue: u8,
|
||||
}
|
||||
|
||||
impl Character {
|
||||
// Big ass ugly match case
|
||||
pub fn set_field(&mut self, field: &str, value: &str) -> Result<(), String> {
|
||||
|
||||
Reference in New Issue
Block a user