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"]; }
public GotGodchildEvent(Bundle serverData) : base(serverData) { Gamer = new GamerInfo(serverData["event"]["godchildren"]); Reward = serverData["reward"]; }
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; }); }
internal MatchInviteEvent(Gamer gamer, Bundle serverData) : base(gamer, serverData) { Inviter = new GamerInfo(serverData["event"]["inviter"]); }