// GET api/values/5
        public TournamentInstance Get(int id)
        {
            var tournament = new TournamentInstance();

            tournament.LaunchTournament();
            return(tournament);
        }
Exemple #2
0
 private void onTournamentSelected(Player player, TournamentInstance selectedTournament, TournamentInstance unselectedTournament)
 {
     if (selectedTournament != null)
     {
         player.Tournaments.markTournamentAsNotified(selectedTournament.TournamentId);
     }
 }
Exemple #3
0
 private void onAdWatched(VideoResult result)
 {
     if (result.Success)
     {
         AdsData customData = (AdsData)result.CustomData;
         Player  player     = GameLogic.Binder.GameState.Player;
         if (customData.AdCategory == AdsData.Category.VENDOR)
         {
             player.DailyAdCountVendor++;
         }
         else if (customData.AdCategory == AdsData.Category.ADVENTURE_MYSTERY)
         {
             player.DailyAdCountMystery++;
         }
         else if (customData.AdCategory == AdsData.Category.TOURNAMENT_MYSTERY)
         {
             if (player.Tournaments.hasTournamentSelected())
             {
                 TournamentInstance selectedTournament = player.Tournaments.SelectedTournament;
                 selectedTournament.DailyAdCountMystery++;
             }
         }
         else if ((customData.AdCategory == AdsData.Category.TOURNAMENT_CARDS) && player.Tournaments.hasTournamentSelected())
         {
             TournamentInstance instance2 = player.Tournaments.SelectedTournament;
             instance2.DailyAdCountCards++;
         }
     }
 }
        public int CreateTournament(TournamentInstance tournament)
        {
            var entity = Mapper.Map <Entities.Tournament>(tournament);

            _tournamentRepository.Add(entity);
            _tournamentRepository.SaveChanges();
            return(entity.TournamentId);
        }
 private void onTournamentSelected(Player player, TournamentInstance selectedTournament, TournamentInstance unselectedTournament)
 {
     if (unselectedTournament != null)
     {
         this.unregisterHeroStatsTarget(unselectedTournament.HeroStats);
     }
     if (selectedTournament != null)
     {
         this.registerHeroStatsTarget(selectedTournament.HeroStats);
     }
 }
        public void postDeserializeInitialization()
        {
            if (!string.IsNullOrEmpty(this.SelectedTournamentId))
            {
                this.SelectedTournament = this.getInstanceOrNull(this.SelectedTournamentId);
            }
            else
            {
                this.SelectedTournament = null;
            }
            foreach (KeyValuePair <string, TournamentInstance> pair in this.ActiveInstances)
            {
                TournamentInstance instance = pair.Value;
                instance.Player = this.Player;
                instance.postDeserializeInitialization();
            }
            List <string> list = new List <string>();

            foreach (KeyValuePair <string, TournamentInstance> pair2 in this.ActiveInstances)
            {
                string key = pair2.Key;
                if (pair2.Value.CurrentState == TournamentInstance.State.CLEARED_FOR_REMOVAL)
                {
                    list.Add(key);
                }
            }
            for (int i = 0; i < list.Count; i++)
            {
                if (list[i] == this.SelectedTournamentId)
                {
                    this.SelectedTournamentId = null;
                }
                this.ActiveInstances.Remove(list[i]);
            }
            if (!string.IsNullOrEmpty(this.LastUnselectedTournamentId) && !this.ActiveInstances.ContainsKey(this.LastUnselectedTournamentId))
            {
                this.LastUnselectedTournamentId = null;
            }
        }
Exemple #7
0
        public TournamentInstance Start()
        {
            var tournament = new TournamentInstance();

            return(tournament);
        }