示例#1
0
        public void GroupShuffle(int id)
        {
            var pile = (Pile)Group.Find(id);

            var isAsync = _engine.Invoke <bool>(() => pile.Shuffle());

            if (!isAsync)
            {
                return;
            }

            pile.Shuffled += new ShuffleAsync {
                engine = _engine
            }.Continuation;
            _engine.Suspend();
        }
示例#2
0
        public int Random(int min, int max)
        {
            var capture = new RandomAsync {
                engine = _engine, reqId = RandomRequest.GenerateId()
            };

            RandomRequest.Completed += capture.Continuation;
            using (new Mute(_engine.CurrentJob.Muted))
                Program.Client.Rpc.RandomReq(capture.reqId, min, max);
            _engine.Suspend();
            return(capture.result);
        }
示例#3
0
 public T Get()
 {
     Task.Factory.StartNew(RunThread);
     _engine.Suspend();
     return(_result);
 }