Exemplo n.º 1
0
 internal Score(Bundle serverData)
     : base(serverData)
 {
     GamerInfo = new GamerInfo(serverData);
     Info = serverData["score"]["info"];
     PostedAt = Common.ParseHttpDate(serverData["score"]["timestamp"]);
     Rank = serverData["rank"];
     Value = serverData["score"]["score"];
 }
Exemplo n.º 2
0
 public GotGodchildEvent(Bundle serverData)
     : base(serverData)
 {
     Gamer = new GamerInfo(serverData["event"]["godchildren"]);
     Reward = serverData["reward"];
 }
Exemplo n.º 3
0
 private void UpdateWithServerData(Bundle serverData)
 {
     Lock(() => {
         if (serverData.Has("creator")) Creator = new GamerInfo(serverData["creator"]);
         if (serverData.Has("customProperties")) CustomProperties = serverData["customProperties"];
         if (serverData.Has("domain")) Domain = serverData["domain"];
         if (serverData.Has("description")) Description = serverData["description"];
         if (serverData.Has("globalState")) GlobalState = serverData["globalState"];
         MatchId = serverData["_id"];
         if (serverData.Has("maxPlayers")) MaxPlayers = serverData["maxPlayers"];
         if (serverData.Has("seed")) Seed = serverData["seed"];
         Status = Common.ParseEnum<MatchStatus>(serverData["status"]);
         if (serverData.Has("shoe")) Shoe = serverData["shoe"];
         // Process pending events
         if (serverData.Has("events")) {
             Moves.Clear();
             foreach (var b in serverData["events"].AsArray()) {
                 if (b["type"] == "match.move") {
                     Moves.Add(new MatchMove(serverData["event"]["player_id"], serverData["event"]["move"]));
                 }
             }
         }
         // Players
         if (serverData.Has("players")) {
             Players.Clear();
             foreach (var b in serverData["players"].AsArray()) {
                 Players.Add(new GamerInfo(b));
             }
         }
         // Last event ID (null if 0; =first time)
         string lastEvent = serverData["lastEventId"];
         if (lastEvent != "0") LastEventId = lastEvent;
     });
 }
Exemplo n.º 4
0
 internal MatchInviteEvent(Gamer gamer, Bundle serverData)
     : base(gamer, serverData)
 {
     Inviter = new GamerInfo(serverData["event"]["inviter"]);
 }