1212import com .google .gson .JsonElement ;
1313import com .google .gson .JsonObject ;
1414import material .DestinyAPI ;
15+ import material .stats .ActivityMode ;
1516import material .user .BungieUser ;
1617import utils .HttpUtils ;
1718import utils .StringUtils ;
@@ -216,14 +217,11 @@ private int[] splitIntoParts(int whole, int parts) {
216217 return arr ;
217218 }
218219
220+ /**
221+ * Returns if this BungieUser is a member of the clan
222+ */
219223 public boolean isMember (BungieUser bungieUser ) {
220- for (BungieUser bungieUser1 : getMembers ()) {
221- if (bungieUser1 .getBungieMembershipID ().equals (bungieUser .getBungieMembershipID ())) {
222- return true ;
223- }
224- }
225-
226- return false ;
224+ return isMember (bungieUser .getBungieMembershipID ());
227225 }
228226
229227 public boolean isMember (String bungieID ) {
@@ -236,10 +234,23 @@ public boolean isMember(String bungieID) {
236234 return false ;
237235 }
238236
239- public JsonObject getClanStats () {
240- return hu .urlRequestGET ("https://www.bungie.net/Platform/Destiny2/Stats/AggregateClanStats/" + getClanID () + "/?modes=4" );
237+ /**
238+ * Retrieve a JsonObject depicting the top stats of the clna
239+ * Unfortunately does not say who has those top stats
240+ */
241+ public JsonObject getClanStats (ActivityMode ... filter ) {
242+ String queryString = "/?modes=" ;
243+ for (ActivityMode activityMode : filter ) {
244+ queryString = queryString .concat (activityMode .getBungieValue () + "," );
245+ }
246+ queryString = queryString .substring (0 , queryString .length () - 2 ); // Remove the last comma
247+
248+ return hu .urlRequestGET ("https://www.bungie.net/Platform/Destiny2/Stats/AggregateClanStats/" + getClanID () + queryString );
241249 }
242250
251+ /**
252+ * Get the date that this user joined the clan
253+ */
243254 public Date getJoinDate (BungieUser member ) {
244255 if (jj == null ) {
245256 jj = hu .urlRequestGET ("https://www.bungie.net/Platform/GroupV2/" + clanId + "/Members/" ).get ("Response" ).getAsJsonObject ();
@@ -255,6 +266,9 @@ public Date getJoinDate(BungieUser member) {
255266 return null ; // Return null if there were no matching users found
256267 }
257268
269+ /**
270+ * Get the management class for this clan
271+ */
258272 public ClanManagement getClanManagement () {
259273 if (clanManagement != null ) { return clanManagement ; }
260274 clanManagement = new ClanManagement (this );
0 commit comments