Enum lichen::source::Src
[−]
[src]
pub enum Src { Logic(String, Logic), If(Expect, Vec<Var>, Option<Next>), Or(Vec<Var>, Option<Next>), Emit(Vec<Var>), Composite(String, Expect, Vec<String>), Next(Next), Mut(Mut, String, Vec<Var>), When(WhenMap), }
Source block statement types
Variants
Logic(String, Logic)
Standard logic, eg: has_sword_item i
If(Expect, Vec<Var>, Option<Next>)
References logic in env and emits varkinds
Logic must resolve to true eg: if item_logic give_quest Can optionally end execution and begin next node
Or(Vec<Var>, Option<Next>)
Or must follow an previous If
Or only fires when previous If logic fails
Emit(Vec<Var>)
Just emits variables
Composite(String, Expect, Vec<String>)
A composite logic type to group logic statements together
Next(Next)
Ends execution and begins next node
Mut(Mut, String, Vec<Var>)
Mutate type, var being mutated, argument vars
When(WhenMap)
Match-like behavior for Mutations
Map format should have Logic-Tested for the key and Mutation Function Signature for the value
Methods
impl Src
[src]
fn eval<D: Eval>(
&self,
state: &mut HashMap<String, bool>,
data: &mut D,
def: &mut Def
) -> (Vec<Var>, Option<Next>)
&self,
state: &mut HashMap<String, bool>,
data: &mut D,
def: &mut Def
) -> (Vec<Var>, Option<Next>)