Skip to content

Commit 9186f41

Browse files
author
Damian Staszewski
committed
moved match id's by queue
1 parent b283bb9 commit 9186f41

File tree

3 files changed

+42
-33
lines changed

3 files changed

+42
-33
lines changed

src/main/java/pl/stachuofficial/hirezapi/games/HiRez.java

Lines changed: 16 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -182,36 +182,6 @@ public StringData getMatchPlayingDetails(int match_id) {
182182
return getMatchPlayingDetails(String.valueOf(match_id));
183183
}
184184

185-
/**
186-
* Getting matches ID by Queue.
187-
* @param queue the id of the game mode. See {@link Smite.Queue}
188-
* @param date Date using by {@link Date} or similar.
189-
* @param allDay An parameter represents it would be the entire day, but be warned that this may be more data than we can return for certain queues.
190-
* @return Lists all Match IDs for a particular Match Queue; useful for API developers interested in constructing data by Queue.
191-
*/
192-
public StringData getMatchIDsByQueue(Smite.Queue queue, Date date, boolean allDay) {
193-
SimpleDateFormat date_path = (allDay) ? new SimpleDateFormat("yyyyMMdd/-1") : new SimpleDateFormat("yyyyMMdd/HH");
194-
SimpleDateFormat minute = new SimpleDateFormat("mm");
195-
String min = String.valueOf(Integer.parseInt(minute.format(date)) - (Integer.parseInt(minute.format(date)) % 10));
196-
String path = date_path.format(date) + ((!allDay) ? "," + min : "");
197-
return get("getmatchidsbyqueue", Integer.toString(queue.getId()), path);
198-
}
199-
200-
/**
201-
* Getting matches ID by Queue.
202-
* @param queue the id of the game mode. See {@link Smite.Queue}
203-
* @param date Date using by {@link Date} or similar. Required to limiting data return.
204-
* @param allDay An parameter represents it would be the entire day, but be warned that this may be more data than we can return for certain queues.
205-
* @return Lists all Match IDs for a particular Match Queue; useful for API developers interested in constructing data by Queue.
206-
*/
207-
public StringData getMatchIDsByQueue(Paladins.Queue queue, Date date, boolean allDay) {
208-
SimpleDateFormat date_path = (allDay) ? new SimpleDateFormat("yyyyMMdd/-1") : new SimpleDateFormat("yyyyMMdd/HH");
209-
SimpleDateFormat minute = new SimpleDateFormat("mm");
210-
String min = String.valueOf(Integer.parseInt(minute.format(date)) - (Integer.parseInt(minute.format(date)) % 10));
211-
String path = date_path.format(date) + ((!allDay) ? "," + min : "");
212-
return get("getmatchidsbyqueue", Integer.toString(queue.getId()), path);
213-
}
214-
215185
/**
216186
* Getting League Leaderboard
217187
* @param queue the id of the game mode. See {@link Smite.Queue}
@@ -306,6 +276,22 @@ public StringData getPlayer(String username) {
306276
return get("getplayer", username);
307277
}
308278

279+
280+
/**
281+
* Getting matches ID by Queue.
282+
* @param queue the id of the game mode. See {@link Smite.Queue}
283+
* @param date Date using by {@link Date} or similar. Required to limiting data return.
284+
* @param allDay An parameter represents it would be the entire day, but be warned that this may be more data than we can return for certain queues.
285+
* @return Lists all Match IDs for a particular Match Queue; useful for API developers interested in constructing data by Queue.
286+
*/
287+
StringData getMatchIDsByQueue(int queue, Date date, boolean allDay) {
288+
SimpleDateFormat date_path = (allDay) ? new SimpleDateFormat("yyyyMMdd/-1") : new SimpleDateFormat("yyyyMMdd/HH");
289+
SimpleDateFormat minute = new SimpleDateFormat("mm");
290+
String min = String.valueOf(Integer.parseInt(minute.format(date)) - (Integer.parseInt(minute.format(date)) % 10));
291+
String path = date_path.format(date) + ((!allDay) ? "," + min : "");
292+
return get("getmatchidsbyqueue", Integer.toString(queue), path);
293+
}
294+
309295
/**
310296
* Getting player status in the game
311297
* @param username This may either be:

src/main/java/pl/stachuofficial/hirezapi/games/Paladins.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
package pl.stachuofficial.hirezapi.games;
22

33

4-
import pl.stachuofficial.hirezapi.api.instance.Language;
54
import pl.stachuofficial.hirezapi.api.StringData;
5+
import pl.stachuofficial.hirezapi.api.instance.Language;
66

7+
import java.util.Date;
78
import java.util.HashMap;
89
import java.util.Map;
910

@@ -227,5 +228,14 @@ public StringData getChampionSkins(int champId) {
227228
*/
228229
public StringData getChampionRecommendedItems(int champId) { return getChampionRecommendedItems(champId, Language.English); }
229230

230-
231+
/**
232+
* Getting matches ID by Queue.
233+
* @param queue the id of the game mode. See {@link Smite.Queue}
234+
* @param date Date using by {@link Date} or similar. Required to limiting data return.
235+
* @param allDay An parameter represents it would be the entire day, but be warned that this may be more data than we can return for certain queues.
236+
* @return Lists all Match IDs for a particular Match Queue; useful for API developers interested in constructing data by Queue.
237+
*/
238+
public StringData getMatchIDsByQueue(Paladins.Queue queue, Date date, boolean allDay) {
239+
return getMatchIDsByQueue(queue.getId(), date, allDay);
240+
}
231241
}

src/main/java/pl/stachuofficial/hirezapi/games/Smite.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
package pl.stachuofficial.hirezapi.games;
22

3-
import pl.stachuofficial.hirezapi.api.instance.Language;
43
import pl.stachuofficial.hirezapi.api.StringData;
4+
import pl.stachuofficial.hirezapi.api.instance.Language;
55

6+
import java.util.Date;
67
import java.util.HashMap;
78
import java.util.Map;
89

@@ -232,4 +233,16 @@ public StringData getGodRecommendedItems(String godId) {
232233
public StringData getGodRecommendedItems(int godId) {
233234
return getGodRecommendedItems(godId, Language.English);
234235
}
236+
237+
238+
/**
239+
* Getting matches ID by Queue.
240+
* @param queue the id of the game mode. See {@link Smite.Queue}
241+
* @param date Date using by {@link Date} or similar.
242+
* @param allDay An parameter represents it would be the entire day, but be warned that this may be more data than we can return for certain queues.
243+
* @return Lists all Match IDs for a particular Match Queue; useful for API developers interested in constructing data by Queue.
244+
*/
245+
public StringData getMatchIDsByQueue(Smite.Queue queue, Date date, boolean allDay) {
246+
return getMatchIDsByQueue(queue.getId(), date, allDay);
247+
}
235248
}

0 commit comments

Comments
 (0)