public override void ToBool(Scope scope, Dictionary<int, Var> returnTarget, int returnID){ Var _toBool = GetMeta(scope, "_tobool"); if(_toBool!=nil){ if(_toBool is VarNumber) returnTarget[returnID] = _toBool; else scope.callstack.Push(new DoLater(delegate{ _toBool.Call(scope, returnTarget, returnID, this); })); return; } returnTarget[returnID] = new VarNumber((string_vars.Count + number_vars.Count + other_vars.Count)>0?1:0); }
public virtual void ToNumber(Scope scope, Dictionary<int, Var> returnTarget, int returnID){ Var _tonumber = GetMeta(scope, "_tonumber"); if(_tonumber!=nil){ if(_tonumber is VarNumber) returnTarget[returnID] = _tonumber; else scope.callstack.Push(new DoLater(delegate{ _tonumber.Call(scope, returnTarget, returnID, this); })); return; } returnTarget[returnID] = new VarNumber(0); }
public override void ToBool(Scope scope, Dictionary<int, Var> returnTarget, int returnID){ returnTarget[returnID] = new VarNumber(this.data>0?1:0); }