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) }) )); }
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; } }