public override DHJassValue GetResult() { if (command == null) { if (!TryParseCode(code, out command)) { command = new DHJassPassValueCommand(new DHJassUnusedType()); } } return(command.GetResult()); }
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); }
public override DHJassValue GetResult() { if (command == null) { if (!TryParseCode(code, out command)) command = new DHJassPassValueCommand(new DHJassUnusedType()); } return command.GetResult(); }
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); }
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; }