Пример #1
0
 static IPromise <GameMoveOperationData> GenerateRevealMoveOperation(RevealMoveData data)
 {
     return(Repository.GetInPromise(data.match, () => ApiManager.Instance.Database.GetMatche(data.match.Id)).Then(match =>
                                                                                                                  Repository.GetInPromise(match.Tournament, () => ApiManager.Instance.Database.GetTournament(match.Tournament.Id)).Then(tournament => new GameMoveOperationData {
         Fee = new AssetData(0L, tournament.Options.BuyIn.Asset),
         Game = data.game,
         Player = data.player,
         Move = new RockPaperScissorsThrowRevealData(data.nonce2, data.gesture)
     })
                                                                                                                  ));
 }
Пример #2
0
 public void Reveal()
 {
     if (IsCommited && !IsRevealed)
     {
         var data = new RevealMoveData {
             game    = game.Id,
             match   = game.Match,
             player  = player,
             nonce2  = nonce2,
             gesture = gesture
         };
         GenerateRevealMoveOperation(data).Then(operation => RevealMove(operation));
         IsRevealed = true;
     }
 }