Exemplo n.º 1
0
 public override DHJassValue GetResult()
 {
     if (command == null)
     {
         if (!TryParseCode(code, out command))
         {
             command = new DHJassPassValueCommand(new DHJassUnusedType());
         }
     }
     return(command.GetResult());
 }
Exemplo n.º 2
0
        public static bool TryGetFunctionPointerCommand(string name, out DHJassCommand functionPointer)
        {
            DHJassFunction function;

            if (DHJassExecutor.Functions.TryGetValue(name, out function))
            {
                functionPointer = new DHJassPassValueCommand(new DHJassCode(null, function));
                return(true);
            }

            functionPointer = new DHJassPassValueCommand(null);
            return(false);
        }
Exemplo n.º 3
0
 public override DHJassValue GetResult()
 {
     if (command == null)
     {
         if (!TryParseCode(code, out command))
             command = new DHJassPassValueCommand(new DHJassUnusedType());
     }
     return command.GetResult();
 }
Exemplo n.º 4
0
        protected override DHJassValue Run()
        {
            trigger t = args["whichTrigger"].HandleValue as trigger;
            if (t == null) return new DHJassHandle(null, 0);

            // create game state command
            string stateName = gamestate.getName(args["whichState"].IntValue);
            DHJassGetGameStateCommand gs_cmd = new DHJassGetGameStateCommand(stateName);

            // create limitval command
            DHJassPassValueCommand lv_cmd = new DHJassPassValueCommand(args["limitval"]);

            // get opcode
            AnyOperation opcode = (AnyOperation)args["opcode"].IntValue;

            // create command for this event
            DHJassOperationCommand opcmd = new DHJassOperationCommand(gs_cmd, lv_cmd, opcode);

            triggercommandevent tce = new triggercommandevent(t, opcmd);
            gamestate.statechanged += tce.OnEvent;

            return new DHJassHandle(null, tce.handle);
        }
Exemplo n.º 5
0
        public static bool TryGetFunctionPointerCommand(string name, out DHJassCommand functionPointer)
        {
            DHJassFunction function;
            if (DHJassExecutor.Functions.TryGetValue(name, out function))
            {
                functionPointer = new DHJassPassValueCommand(new DHJassCode(null, function));
                return true;
            }

            functionPointer = new DHJassPassValueCommand(null);
            return false;
        }