2023-10-04 17:21:15 +00:00
|
|
|
@table(TypedName, EnumName) character_states:
|
|
|
|
{
|
|
|
|
{ "none", None },
|
|
|
|
{ "normal", Normal },
|
|
|
|
{ "happy", Happy },
|
2023-10-29 10:00:34 +00:00
|
|
|
{ "leaning", Leaning },
|
2023-10-04 17:21:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@table_gen
|
|
|
|
{
|
|
|
|
`enum character_state`;
|
|
|
|
`{`;
|
|
|
|
`CR_State_Invalid = 0,`
|
|
|
|
@expand(character_states s) `CR_State_$(s.EnumName),`
|
|
|
|
`};`;
|
|
|
|
}
|
|
|
|
|
|
|
|
@table_gen @c
|
|
|
|
{
|
|
|
|
`static character_state CR_CharacterStateFromString(string String)`;
|
|
|
|
`{`;
|
|
|
|
`character_state Result = CR_State_Invalid;`;
|
|
|
|
`if(0) {}`;
|
|
|
|
@expand(character_states s) `else if(AreEqual(String, StrLit("$(s.TypedName)")))$(=>40) { Result = CR_State_$(s.EnumName); }`;
|
|
|
|
`return(Result);`;
|
|
|
|
`}`;
|
|
|
|
}
|