Ejemplo n.º 1
0
        public GwMatchDetails GetMatchDetails(string matchId)
        {
            var request = new RestRequest(RequestUrls["MatchDetails"], Method.GET);

            request.AddParameter("match_id", matchId);
            var response = client.Execute <MatchDetailsResult>(request);

            var details = new GwMatchDetails(response.Data.match_id);
            var maps    = new List <GwMatchMap>();

            foreach (var m in response.Data.maps)
            {
                var map        = new GwMatchMap(details, m.type, m.scores);
                var objectives = new List <GwMatchObjective>();
                foreach (var o in m.objectives)
                {
                    objectives.Add(new GwMatchObjective(details, map, o.id, nameCache.GetObjective(o.id), o.owner));
                }
                map.Objectives = objectives.AsReadOnly();
                maps.Add(map);
            }
            details.Score = new GwMatchScore(response.Data.scores);
            details.Maps  = maps.AsReadOnly();
            return(details);
        }
Ejemplo n.º 2
0
 public GwMatchObjective(GwMatchDetails details, GwMatchMap map, string id, string name, GwMatchTeam owner)
 {
     Details = details;
     Map     = map;
     Id      = id;
     Name    = name;
     Owner   = owner;
 }
Ejemplo n.º 3
0
 public GwMatchObjective(GwMatchDetails details, GwMatchMap map, string id, string name, GwMatchTeam owner)
 {
     Details = details;
     Map = map;
     Id = id;
     Name = name;
     Owner = owner;
 }
Ejemplo n.º 4
0
        public GwMatchDetails GetMatchDetails(string matchId)
        {
            var request = new RestRequest(RequestUrls["MatchDetails"], Method.GET);
            request.AddParameter("match_id", matchId);
            var response = client.Execute<MatchDetailsResult>(request);

            var details = new GwMatchDetails(response.Data.match_id);
            var maps = new List<GwMatchMap>();
            foreach (var m in response.Data.maps)
            {
                var map = new GwMatchMap(details, m.type, m.scores);
                var objectives = new List<GwMatchObjective>();
                foreach (var o in m.objectives)
                {
                    objectives.Add(new GwMatchObjective(details, map, o.id, nameCache.GetObjective(o.id), o.owner));
                }
                map.Objectives = objectives.AsReadOnly();
                maps.Add(map);
            }
            details.Score = new GwMatchScore(response.Data.scores);
            details.Maps = maps.AsReadOnly();
            return details;
        }