public Task <TransactionReceipt> SendMessageRequestAndWaitForReceiptAsync(string target, byte[] message, uint gasLimit, CancellationTokenSource cancellationToken = null)
        {
            var sendMessageFunction = new SendMessageFunction();

            sendMessageFunction.Target   = target;
            sendMessageFunction.Message  = message;
            sendMessageFunction.GasLimit = gasLimit;

            return(ContractHandler.SendRequestAndWaitForReceiptAsync(sendMessageFunction, cancellationToken));
        }
        public Task <string> SendMessageRequestAsync(string target, byte[] message, uint gasLimit)
        {
            var sendMessageFunction = new SendMessageFunction();

            sendMessageFunction.Target   = target;
            sendMessageFunction.Message  = message;
            sendMessageFunction.GasLimit = gasLimit;

            return(ContractHandler.SendRequestAsync(sendMessageFunction));
        }
        static public ScriptFunction createFuncObj(String func_name, String args)
        {
            ScriptFunction func = null;

            switch (func_name)
            {
            case "ActiveWindow":
                func = new ActiveWindowFunction(args);
                break;

            case "SetAndCheckWinRect":
                func = new SetAndCheckWinRectFunction(args);
                break;

            case "CopyClipboard":
                func = new CopyClipboardFunction(args);
                break;

            case "sleep":
                func = new sleepFunction(args);
                break;

            case "SendInput":
                func = new SendInputFunction(args);
                break;

            case "SetMouse":
                func = new SetMouseFunction(args);
                break;

            case "SendMessage":
                func = new SendMessageFunction(args);
                break;

            case "CheckResolution":
                func = new CheckResolutionFunction(args);
                break;

            case "ReplaceString":
                func = new ReplaceStringFunction(args);
                break;

            default:
                Trace.WriteLine("no cmd know" + func_name);
                break;
            }
            return(func);
        }
Beispiel #4
0
        /// <summary>
        /// Creates a new agent with the specified position, velocity, radiation function and send message function.
        /// </summary>
        /// <param name="PX">Represents the X coordinate of the agent position.</param>
        /// <param name="PY">Represents the Y coordinate of the agent position.</param>
        /// <param name="VX">Represents the X coordinate of the agent velocity.</param>
        /// <param name="VY">Represents the Y coordinate of the agent velocity.</param>
        /// <param name="RadiationFunction">Represents the function used by the agent to calculate the radiation intensity as measured by a sensor at any given position.</param>
        /// <param name="SendMessage">// Represents the function used by the agent to send messages to other nearby agents.</param>
        public Agent(double PX, double PY, double VX, double VY, PositionFunction RadiationFunction, SendMessageFunction SendMessage)
        {
            this.PX = PX;
            this.PY = PY;

            this.VX = VX;
            this.VY = VY;

            this.MyBestX = PX;
            this.MyBestY = PY;

            this.RadiationFunction = RadiationFunction;

            // Evaluate the radiation intensity at te initial position as the best visited-by-the-agent position til now.
            this.MyBestValue = RadiationFunction(PX, PY);

            this.SendMessage = SendMessage;
        }
 public static ScriptFunction createFuncObj(String func_name, String args)
 {
     ScriptFunction func = null;
     switch (func_name) {
         case "ActiveWindow":
             func = new ActiveWindowFunction(args);
             break;
         case "SetAndCheckWinRect":
             func = new SetAndCheckWinRectFunction(args);
             break;
         case "CopyClipboard":
             func = new CopyClipboardFunction(args);
             break;
         case "sleep":
             func = new sleepFunction(args);
             break;
         case "SendInput":
             func = new SendInputFunction(args);
             break;
         case "SetMouse":
             func = new SetMouseFunction(args);
             break;
         case "SendMessage":
             func = new SendMessageFunction(args);
             break;
         case "CheckResolution":
             func = new CheckResolutionFunction(args);
             break;
         case "ReplaceString":
             func = new ReplaceStringFunction(args);
             break;
         default:
             Trace.WriteLine("no cmd know" + func_name);
             break;
     }
     return func;
 }
Beispiel #6
0
 public Task <TransactionReceipt> SendMessageRequestAndWaitForReceiptAsync(SendMessageFunction sendMessageFunction, CancellationTokenSource cancellationToken = null)
 {
     return(ContractHandler.SendRequestAndWaitForReceiptAsync(sendMessageFunction, cancellationToken));
 }
Beispiel #7
0
 public Task <string> SendMessageRequestAsync(SendMessageFunction sendMessageFunction)
 {
     return(ContractHandler.SendRequestAsync(sendMessageFunction));
 }