Exemplo n.º 1
0
        public Level GetLevelFromSiteUri(string siteUri, LevelEmbeds embeds = default(LevelEmbeds))
        {
            var id = GetLevelIDFromSiteUri(siteUri);

            if (string.IsNullOrEmpty(id))
                return null;

            return GetLevel(id, embeds);
        }
Exemplo n.º 2
0
        public Level GetLevelFromSiteUri(string siteUri, LevelEmbeds embeds = default(LevelEmbeds))
        {
            var id = GetLevelIDFromSiteUri(siteUri);

            if (string.IsNullOrEmpty(id))
            {
                return(null);
            }

            return(GetLevel(id, embeds));
        }
Exemplo n.º 3
0
        public Level GetLevel(string levelId, 
            LevelEmbeds embeds = default(LevelEmbeds))
        {
            var parameters = new List<string>() { embeds.ToString() };

            var uri = GetLevelsUri(string.Format("/{0}{1}",
                Uri.EscapeDataString(levelId),
                parameters.ToParameters()));

            var result = baseClient.DoRequest(uri);

            return Level.Parse(baseClient, result.data);
        }
Exemplo n.º 4
0
        public Level GetLevel(string levelId,
                              LevelEmbeds embeds = default(LevelEmbeds))
        {
            var parameters = new List <string>()
            {
                embeds.ToString()
            };

            var uri = GetLevelsUri(string.Format("/{0}{1}",
                                                 Uri.EscapeDataString(levelId),
                                                 parameters.ToParameters()));

            var result = baseClient.DoRequest(uri);

            return(Level.Parse(baseClient, result.data));
        }
Exemplo n.º 5
0
        public ReadOnlyCollection <Level> GetLevels(string gameId,
                                                    LevelEmbeds embeds     = default(LevelEmbeds),
                                                    LevelsOrdering orderBy = default(LevelsOrdering))
        {
            var parameters = new List <string>()
            {
                embeds.ToString()
            };

            parameters.AddRange(orderBy.ToParameters());

            var uri = GetGamesUri(string.Format("/{0}/levels{1}",
                                                Uri.EscapeDataString(gameId),
                                                parameters.ToParameters()));

            return(baseClient.DoDataCollectionRequest(uri,
                                                      x => Level.Parse(baseClient, x) as Level));
        }
Exemplo n.º 6
0
        public ReadOnlyCollection<Level> GetLevels(string gameId,
            LevelEmbeds embeds = default(LevelEmbeds),
            LevelsOrdering orderBy = default(LevelsOrdering))
        {
            var parameters = new List<string>() { embeds.ToString() };

            parameters.AddRange(orderBy.ToParameters());

            var uri = GetGamesUri(string.Format("/{0}/levels{1}",
                Uri.EscapeDataString(gameId),
                parameters.ToParameters()));

            return baseClient.DoDataCollectionRequest(uri,
                 x => Level.Parse(baseClient, x) as Level);
        }