public override void OnNavigatedTo(INavigationParameters parameters) { base.OnNavigatedTo(parameters); _tournament = parameters.GetValue <TournamentResponse>("tournament"); Title = _tournament.Name; }
private Tournament ParseLastTournament(TournamentResponse response) { Tournament tournament = null; if (response.TournamentsData.Count == 0) { Service.Get <StaRTSLogger>().WarnFormat("Client is trying to redeem tournament(s), however server does not redeem anything. Player ID: {0}", new object[] { this.currentPlayer.PlayerId }); } foreach (Tournament current in response.TournamentsData) { tournament = this.currentPlayer.TournamentProgress.GetTournament(current.Uid); tournament.Sync(current); this.NotifyEndForTournamentVO = Service.Get <IDataController>().Get <TournamentVO>(tournament.Uid); } InventoryCrates crates = Service.Get <CurrentPlayer>().Prizes.Crates; Dictionary <string, object> cratesJsonData = response.CratesJsonData; if (response.Rewards.Count > 0) { crates.UpdateAndBadgeFromServerObject(cratesJsonData); } else { crates.FromObject(cratesJsonData); } return(tournament); }
public override void OnNavigatedTo(INavigationParameters parameters) { base.OnNavigatedTo(parameters); if (parameters.ContainsKey("tournament")) { _tournament = parameters.GetValue <TournamentResponse>("tournament"); Title = $"{_tournament.Name}"; } }
public override void OnNavigatedTo(INavigationParameters parameters) /*página que recupera el parámetro que viene de la otra página*/ { base.OnNavigatedTo(parameters); Tournament = parameters.GetValue <TournamentResponse>("tournament"); Title = Tournament.Name; Groups = transformHelper.ToGroups(Tournament.Groups); }
private void OnTournamentRedeemed(TournamentResponse response, object cookie) { Tournament cookie2 = this.ParseLastTournament(response); Service.Get <EventManager>().SendEvent(EventId.TournamentRedeemed, cookie2); if (Service.Get <GameStateMachine>().CurrentState is HomeState) { this.ShowTournamentEnded(); return; } Service.Get <EventManager>().RegisterObserver(this, EventId.WorldInTransitionComplete, EventPriority.Default); }
public TournamentEntity ToTournamentEntity(TournamentResponse model) { return(new TournamentEntity { EndDate = model.EndDate, IsActive = model.IsActive, Name = model.Name, StartDate = model.StartDate, Id = model.Id, LogoPath = model.LogoPath, }); }
public async Task <IActionResult> GetTournament([FromRoute] Guid tournamentId) { try { var projection = await _tournamentQueryHandler.GetTournamentAsync(tournamentId); return(Ok(TournamentResponse.From(projection))); } catch { return(NotFound()); } }
private void OnTournamentRedeemedNoDialog(TournamentResponse response, object cookie) { Tournament cookie2 = this.ParseLastTournament(response); Service.Get <EventManager>().SendEvent(EventId.TournamentRedeemed, cookie2); }
// Update is called once per frame public void HandleResponse(string response) { TournamentResponse tournamentResponse = JsonUtility.FromJson <TournamentResponse>(response); SpawnTournamentElements(tournamentResponse.data); }
public async Task <IActionResult> GetTournaments() { var projection = await _tournamentQueryHandler.GetTournamentsAsync(); return(Ok(TournamentResponse.From(projection))); }