Skip to content

Commit 5a58c14

Browse files
committed
Restructure leaderboard classes into header described sections
1 parent bbd4fc4 commit 5a58c14

File tree

1 file changed

+90
-78
lines changed

1 file changed

+90
-78
lines changed

Runtime/Game/Requests/LeaderboardRequest.cs

Lines changed: 90 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,9 @@
44

55
namespace LootLocker.Requests
66
{
7-
public class LootLockerGetMemberRankResponse : LootLockerResponse
8-
{
9-
// we are doing thisfor legacy reasons, since it is no longer being set on the backend
10-
public string member_id { get; set; }
11-
public int rank { get; set; }
12-
public int score { get; set; }
13-
public LootLockerPlayer player { get; set; }
14-
public string metadata { get; set; }
15-
}
16-
7+
//==================================================
8+
// Data Definitions
9+
//==================================================
1710
public class LootLockerPlayer
1811
{
1912
public int id { get; set; }
@@ -22,12 +15,6 @@ public class LootLockerPlayer
2215
public string ulid { get; set; }
2316
}
2417

25-
26-
public class LootLockerGetByListOfMembersResponse : LootLockerResponse
27-
{
28-
public LootLockerLeaderboardMember[] members { get; set; }
29-
}
30-
3118
public class LootLockerLeaderboardMember
3219
{
3320
public string member_id { get; set; }
@@ -37,50 +24,12 @@ public class LootLockerLeaderboardMember
3724
public string metadata { get; set; }
3825
}
3926

40-
public class LootLockerGetScoreListResponse : LootLockerResponse
41-
{
42-
public LootLockerPagination pagination { get; set; }
43-
public LootLockerLeaderboardMember[] items { get; set; }
44-
}
45-
46-
47-
public class LootLockerGetAllMemberRanksResponse : LootLockerResponse
48-
{
49-
public LootLockerLeaderboard[] leaderboards { get; set; }
50-
public LootLockerPagination pagination { get; set; }
51-
}
52-
5327
public class LootLockerLeaderboard
5428
{
5529
public LootLockerLeaderboardMember rank { get; set; }
5630
public int leaderboard_id { get; set; }
5731
public string leaderboard_key { get; set; }
5832
}
59-
60-
public class LootLockerPagination
61-
{
62-
public int total { get; set; }
63-
public int? next_cursor { get; set; }
64-
public int? previous_cursor { get; set; }
65-
public bool allowNext { get; set; }
66-
public bool allowPrev { get; set; }
67-
}
68-
69-
public class LootLockerSubmitScoreResponse : LootLockerResponse
70-
{
71-
public string member_id { get; set; }
72-
public int rank { get; set; }
73-
public int score { get; set; }
74-
public string metadata { get; set; }
75-
}
76-
77-
public class LootLockerLeaderboardArchiveResponse : LootLockerResponse
78-
{
79-
/// <summary>
80-
/// A List of past Leaderboards.
81-
/// </summary>
82-
public LootLockerLeaderboardArchive[] archives { get; set; }
83-
}
8433

8534
public class LootLockerLeaderboardArchive
8635
{
@@ -101,17 +50,7 @@ public class LootLockerLeaderboardArchive
10150
/// </summary>
10251
public int content_length { get; set; }
10352
}
104-
public class LootLockerLeaderboardArchiveDetailsResponse : LootLockerResponse
105-
{
106-
/// <summary>
107-
/// Pagination.
108-
/// </summary>
109-
public LootLockerPaginationResponse<string> pagination { get; set; }
110-
/// <summary>
111-
/// A list of players and details from the archived Leaderboard.
112-
/// </summary>
113-
public LootLockerLeaderboardArchiveDetails[] items { get; set; }
114-
}
53+
11554
public class LootLockerLeaderboardArchiveDetails
11655
{
11756
/// <summary>
@@ -134,8 +73,17 @@ public class LootLockerLeaderboardArchiveDetails
13473
/// The Player's Score on the archived Leaderboard.
13574
/// </summary>
13675
public int score { get; set; }
76+
}
13777

78+
public class LootLockerPagination
79+
{
80+
public int total { get; set; }
81+
public int? next_cursor { get; set; }
82+
public int? previous_cursor { get; set; }
83+
public bool allowNext { get; set; }
84+
public bool allowPrev { get; set; }
13885
}
86+
13987
public class LootLockerLeaderBoardPlayer
14088
{
14189
/// <summary>
@@ -156,6 +104,24 @@ public class LootLockerLeaderBoardPlayer
156104
public string player_ulid { get; set; }
157105

158106
}
107+
108+
109+
//==================================================
110+
// Request Definitions
111+
//==================================================
112+
public class LootLockerGetRequests
113+
{
114+
public int count { get; set; }
115+
public string after { get; set; }
116+
}
117+
118+
public class LootLockerSubmitScoreRequest
119+
{
120+
public string member_id { get; set; }
121+
public int score { get; set; }
122+
public string metadata { get; set; }
123+
}
124+
159125
[Serializable]
160126
public class LootLockerLeaderboardArchiveRequest
161127
{
@@ -171,14 +137,6 @@ public class LootLockerLeaderboardArchiveRequest
171137
/// After specified index.
172138
/// </summary>
173139
public string after { get; set; }
174-
175-
}
176-
177-
public class LootLockerSubmitScoreRequest
178-
{
179-
public string member_id { get; set; }
180-
public int score { get; set; }
181-
public string metadata { get; set; }
182140
}
183141

184142
public class LootLockerGetMemberRankRequest
@@ -213,15 +171,69 @@ public static void Reset()
213171
}
214172
}
215173

216-
public class LootLockerGetRequests
174+
public class LootLockerGetByListMembersRequest
217175
{
218-
public int count { get; set; }
219-
public string after { get; set; }
176+
public string[] members { get; set; }
220177
}
221178

222-
public class LootLockerGetByListMembersRequest
179+
//==================================================
180+
// Response Definitions
181+
//==================================================
182+
183+
public class LootLockerGetMemberRankResponse : LootLockerResponse
223184
{
224-
public string[] members { get; set; }
185+
// we are doing thisfor legacy reasons, since it is no longer being set on the backend
186+
public string member_id { get; set; }
187+
public int rank { get; set; }
188+
public int score { get; set; }
189+
public LootLockerPlayer player { get; set; }
190+
public string metadata { get; set; }
191+
}
192+
193+
194+
public class LootLockerGetByListOfMembersResponse : LootLockerResponse
195+
{
196+
public LootLockerLeaderboardMember[] members { get; set; }
197+
}
198+
199+
public class LootLockerGetScoreListResponse : LootLockerResponse
200+
{
201+
public LootLockerPagination pagination { get; set; }
202+
public LootLockerLeaderboardMember[] items { get; set; }
203+
}
204+
205+
public class LootLockerGetAllMemberRanksResponse : LootLockerResponse
206+
{
207+
public LootLockerLeaderboard[] leaderboards { get; set; }
208+
public LootLockerPagination pagination { get; set; }
209+
}
210+
211+
public class LootLockerSubmitScoreResponse : LootLockerResponse
212+
{
213+
public string member_id { get; set; }
214+
public int rank { get; set; }
215+
public int score { get; set; }
216+
public string metadata { get; set; }
217+
}
218+
219+
public class LootLockerLeaderboardArchiveResponse : LootLockerResponse
220+
{
221+
/// <summary>
222+
/// A List of past Leaderboards.
223+
/// </summary>
224+
public LootLockerLeaderboardArchive[] archives { get; set; }
225+
}
226+
227+
public class LootLockerLeaderboardArchiveDetailsResponse : LootLockerResponse
228+
{
229+
/// <summary>
230+
/// Pagination.
231+
/// </summary>
232+
public LootLockerPaginationResponse<string> pagination { get; set; }
233+
/// <summary>
234+
/// A list of players and details from the archived Leaderboard.
235+
/// </summary>
236+
public LootLockerLeaderboardArchiveDetails[] items { get; set; }
225237
}
226238
}
227239

0 commit comments

Comments
 (0)