Пример #1
0
        public override void OnNavigatedTo(INavigationParameters parameters)
        {
            base.OnNavigatedTo(parameters);

            _tournament = parameters.GetValue <TournamentResponse>("tournament");
            Title       = _tournament.Name;
        }
Пример #2
0
        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);
        }
Пример #3
0
 public override void OnNavigatedTo(INavigationParameters parameters)
 {
     base.OnNavigatedTo(parameters);
     if (parameters.ContainsKey("tournament"))
     {
         _tournament = parameters.GetValue <TournamentResponse>("tournament");
         Title       = $"{_tournament.Name}";
     }
 }
Пример #4
0
        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);
        }
Пример #5
0
        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);
        }
Пример #6
0
 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,
     });
 }
Пример #7
0
    public async Task <IActionResult> GetTournament([FromRoute] Guid tournamentId)
    {
        try
        {
            var projection = await _tournamentQueryHandler.GetTournamentAsync(tournamentId);

            return(Ok(TournamentResponse.From(projection)));
        }
        catch
        {
            return(NotFound());
        }
    }
Пример #8
0
        private void OnTournamentRedeemedNoDialog(TournamentResponse response, object cookie)
        {
            Tournament cookie2 = this.ParseLastTournament(response);

            Service.Get <EventManager>().SendEvent(EventId.TournamentRedeemed, cookie2);
        }
Пример #9
0
    // Update is called once per frame
    public void HandleResponse(string response)
    {
        TournamentResponse tournamentResponse = JsonUtility.FromJson <TournamentResponse>(response);

        SpawnTournamentElements(tournamentResponse.data);
    }
Пример #10
0
    public async Task <IActionResult> GetTournaments()
    {
        var projection = await _tournamentQueryHandler.GetTournamentsAsync();

        return(Ok(TournamentResponse.From(projection)));
    }