コード例 #1
0
ファイル: _Commands.cs プロジェクト: sonygod/dotahit
 public override DHJassValue GetResult()
 {
     if (command == null)
     {
         if (!TryParseCode(code, out command))
         {
             command = new DHJassPassValueCommand(new DHJassUnusedType());
         }
     }
     return(command.GetResult());
 }
コード例 #2
0
ファイル: _Commands.cs プロジェクト: sonygod/dotahit
        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);
        }
コード例 #3
0
ファイル: _Commands.cs プロジェクト: sonygod/dotahit
 public override DHJassValue GetResult()
 {
     if (command == null)
     {
         if (!TryParseCode(code, out command))
             command = new DHJassPassValueCommand(new DHJassUnusedType());
     }
     return command.GetResult();
 }
コード例 #4
0
ファイル: _Functions.cs プロジェクト: sonygod/dotahit
        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);
        }
コード例 #5
0
ファイル: _Commands.cs プロジェクト: sonygod/dotahit
        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;
        }