public IEnumerator UpdateItemView(TournamentObject tournament) { var asset = new AssetObject(); asset = null; TournamentManager.Instance.GetAssetObject(tournament.Options.BuyIn.Asset.Id) .Then(assetResult => asset = assetResult); while (asset.IsNull()) { yield return(null); } tournamentIdText.text = "#RPS" + tournament.Id; tournamentGameText.text = "RPS"; tournamentnumberOfPlayersText.text = tournament.RegisteredPlayers.ToString(); tournamentStartTimeText.text = tournament.StartTime.Value.ToString("dd MMM, yyyy. hh:mm"); tournamentRegisterDeadlineText.text = tournament.Options.RegistrationDeadline.ToString("dd MMM, yyyy. hh:mm"); tournamentBuyinText.text = tournament.Options.BuyIn.Amount / Mathf.Pow(10, asset.Precision) + asset.Symbol; tournamentJackpotText.text = tournament.PrizePool / Mathf.Pow(10, asset.Precision) + asset.Symbol; liveMessage.SetActive(tournament.State.Equals(ChainTypes.TournamentState.InProgress)); }
public virtual IEnumerator UpdateItem(TournamentObject info) { if (gameObject.activeSelf && gameObject.activeInHierarchy) { CurrentTournament = info; if (tournamentDetailsObject.IsNull() || !tournamentDetailsObject.Tournament.Equals(info.Id)) { var detailsObject = new List <TournamentDetailsObject>(); yield return(TournamentManager.Instance.GetTournamentDetailsObject(info.Id.Id, detailsObject)); tournamentDetailsObject = detailsObject[0]; } ID = "#RPS" + info.Id; PlayerRegistered = info.RegisteredPlayers.ToString(); MaxPlayers = info.Options.NumberOfPlayers.ToString(); if (currentAsset.IsNull() || !currentAsset.Id.Equals(currentTournament.Options.BuyIn.Asset)) { AssetObject asset = null; TournamentManager.Instance.GetAssetObject(currentTournament.Options.BuyIn.Asset.Id) .Then(assetResult => asset = assetResult); while (asset.IsNull()) { yield return(null); } currentAsset = asset; } var buyIn = Decimal.Parse((info.Options.BuyIn.Amount / Math.Pow(10, currentAsset.Precision)).ToString(), NumberStyles.Float); BuyIn = buyIn + currentAsset.Symbol; Jackpot = buyIn * info.Options.NumberOfPlayers + currentAsset.Symbol; UpdateStartTime(); } }