Exemple #1
0
 public static DeclarationExecuter Build(Declaration declaration)
 {
     return(declaration switch
     {
         DefineDeclaration define => new DefineDeclarationExecuter(define),
         VariableDeclaration variable => new VariableDeclarationExecuter(variable),
         SoundsDeclaration sounds => new SoundsDeclarationExecuter(sounds),
         ActionDeclaration action => new ActionDeclarationExecuter(action),
         EventDeclaration evt => new EventDeclarationExecuter(evt),
         _ => ErrorHelper.ThrowUnknownNode <DeclarationExecuter>(declaration)
     });
Exemple #2
0
        public ActionDeclarationExecuter(ActionDeclaration action) : base(action)
        {
            name = action.Name?.Name;
            if (during != null)
            {
                during = ExpressionExecuter.Build(action.During);
            }

            body = new List <StatementExecuter>();
            foreach (var stmt in action.Body.Body)
            {
                body.Add(StatementExecuter.Build(stmt));
            }
        }