Evaluate() public method

public Evaluate ( ) : void
return void
コード例 #1
0
ファイル: CommandTemporal.cs プロジェクト: yadenisyur/KOS
 public override void Update(float time)
 {
     if (triggered)
     {
         targetCommand.Update(time);
         if (targetCommand.State == ExecutionState.DONE)
         {
             ParentContext.Unlock(this);
         }
     }
     else if (expression.IsTrue())
     {
         triggered = true;
         targetCommand.Evaluate();
     }
 }
コード例 #2
0
        public override void Evaluate()
        {
            expression    = new Expression(RegexMatch.Groups[1].Value, ParentContext);
            targetCommand = Command.Get(RegexMatch.Groups[2].Value, this);

            if (expression.IsTrue())
            {
                targetCommand.Evaluate();
                Push(targetCommand);
                State = ExecutionState.WAIT;
            }
            else
            {
                State = ExecutionState.DONE;
            }
        }
コード例 #3
0
ファイル: ContextRunProgram.cs プロジェクト: yadenisyur/KOS
        private void EvaluateNextCommand()
        {
            if (this.ChildContext == null)
            {
                if (commands.Count > 0)
                {
                    Command cmd = commands[0];
                    commands.RemoveAt(0);

                    ChildContext = cmd;
                    cmd.Evaluate();
                }
                else
                {
                    State = ExecutionState.DONE;
                }
            }
        }
コード例 #4
0
        public override void Evaluate()
        {
            expression = new Expression(RegexMatch.Groups[1].Value, ParentContext);

            int numLinesChild = Utils.NewLineCount(Input.Substring(0, RegexMatch.Groups[2].Index));

            targetCommand = Get(RegexMatch.Groups[2].Value, this, Line + numLinesChild);

            if (expression.IsTrue())
            {
                targetCommand.Evaluate();
                Push(targetCommand);
                State = ExecutionState.WAIT;
            }
            else
            {
                State = ExecutionState.DONE;
            }
        }
コード例 #5
0
ファイル: CommandTemporal.cs プロジェクト: yadenisyur/KOS
        public override void Update(float time)
        {
            bool newValue;

            if (!objToBool(targetVariable.Value, out newValue))
            {
                ParentContext.Unlock(this);

                throw new Exception("Value type error");
            }

            if (originalValue != newValue)
            {
                ParentContext.Unlock(this);

                targetCommand.Evaluate();
                ParentContext.Push(targetCommand);
            }
        }
コード例 #6
0
ファイル: CommandFlowControl.cs プロジェクト: niomaster/KOS
        public override void Evaluate()
        {
            expression = new Expression(RegexMatch.Groups[1].Value, ParentContext);

            int numLinesChild = Utils.NewLineCount(Input.Substring(0, RegexMatch.Groups[2].Index));
            targetCommand = Get(RegexMatch.Groups[2].Value, this, Line + numLinesChild);

            if (expression.IsTrue())
            {
                targetCommand.Evaluate();
                Push(targetCommand);
                State = ExecutionState.WAIT;
            }
            else
            {
                State = ExecutionState.DONE;
            }
        }
コード例 #7
0
ファイル: CommandFlowControl.cs プロジェクト: kendrome/KOS
        public override void Evaluate()
        {
            expression = new Expression(RegexMatch.Groups[1].Value, ParentContext);
            targetCommand = Command.Get(RegexMatch.Groups[2].Value, this);

            if (expression.IsTrue())
            {
                targetCommand.Evaluate();
                Push(targetCommand);
                State = ExecutionState.WAIT;
            }
            else
            {
                State = ExecutionState.DONE;
            }
        }