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(); }
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); }
public T Get() { Task.Factory.StartNew(RunThread); _engine.Suspend(); return(_result); }