Beispiel #1
0
 static IPromise <GameMoveOperationData> GenerateCommitMoveOperation(CommitMoveData 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 RockPaperScissorsThrowCommitData(data.nonce1, data.hash)
     })
                                                                                                                  ));
 }
Beispiel #2
0
 public void Commit(GameObject game)
 {
     if (!IsCommited)
     {
         this.game = game;
         var data = new CommitMoveData {
             game   = game.Id,
             match  = game.Match,
             player = player,
             nonce1 = nonce1,
             hash   = hash
         };
         GenerateCommitMoveOperation(data).Then(operation => CommitMove(operation));
         IsCommited = true;
     }
 }