Ejemplo n.º 1
0
        public async Task <bool> LoadTrophies(string username)
        {
            Offset    = Offset + MaxCount;
            IsLoading = true;
            var          trophyManager = new TrophyManager();
            TrophyEntity trophyList    = await trophyManager.GetTrophyList(username, Offset, UserAccountEntity);

            if (trophyList == null)
            {
                //HasMoreItems = false;
                return(false);
            }
            foreach (TrophyEntity.TrophyTitle trophy in trophyList.TrophyTitles)
            {
                Add(trophy);
            }
            if (trophyList.TrophyTitles.Any())
            {
                HasMoreItems = true;
                MaxCount    += 64;
            }
            else
            {
                HasMoreItems = false;
            }
            IsLoading = false;
            return(true);
        }
Ejemplo n.º 2
0
        public static void InsertNewTrophy(Guid desafioId, Guid usuarioId, Guid temporadaId, string name, DateTime startDate, DateTime endDate, int parameter, int goal, int prize)
        {
            var newTrophy = new TrophyEntity()
            {
                DesafioId   = desafioId,
                UsuarioId   = usuarioId,
                TemporadaId = temporadaId,
                Name        = name,
                StartDate   = startDate,
                EndDate     = endDate,
                Parameter   = parameter,
                Goal        = goal,
                Prize       = prize
            };

            TrophiesRepository.Get().InsertNewTrophy(newTrophy);
        }