vn/code/vn_scene.md

35 lines
989 B
Markdown

@table(Name, Operator) scene_operator_table:
{
{ Invalid, "###" }
{ Not, "!" }
{ Equal, "=" }
{ Equals, "==" }
{ NotEquals, "!=" }
{ GreaterThanOrEquals, ">=" }
{ LessThanOrEquals, "<=" }
{ Greater, ">" }
{ Less, "<" }
{ Add, "+" }
{ Minus, "-" }
{ Multiply "*" }
{ Divide, "/" }
}
@table_gen
{
`enum scene_operator`;
`{`;
@expand(scene_operator_table s) `S_Operator_$(s.Name),`;
`};`;
}
@table_gen
{
`inline scene_operator S_OperatorFromString(string String)`;
`{`;
`scene_operator Result = S_Operator_Invalid;`;
`if(0) {}`;
@expand(scene_operator_table s) `else if(AreEqual(String, StrLit("$(s.Operator)")))$(=>40) { Result = S_Operator_$(s.Name); }`;
`return(Result);`;;
`}`;
}