Skip to content

Commit

Permalink
More monthlies
Browse files Browse the repository at this point in the history
  • Loading branch information
roccodev committed Jan 26, 2019
1 parent 4f48ffb commit dad48c6
Show file tree
Hide file tree
Showing 24 changed files with 637 additions and 64 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package pw.roccodev.beezig.hiveapi.wrapper.monthly;

import pw.roccodev.beezig.hiveapi.wrapper.utils.json.JObject;

public class PvPMonthlyProfile extends RoccoDevMonthlyProfile {

public PvPMonthlyProfile(JObject source) {
super(source);
}

public long getKills() {
return source.getLong("kills");
}

public long getDeaths() {
return source.getLong("deaths");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package pw.roccodev.beezig.hiveapi.wrapper.monthly;

import pw.roccodev.beezig.hiveapi.wrapper.utils.json.JObject;

public class RoccoDevMonthlyProfile extends MonthlyProfile {

public RoccoDevMonthlyProfile(JObject source) {
super(source);
}

@Override
public long getPoints() {
return source.getLong("points");
}

@Override
public long getPlace() {
return source.getLong("place");
}

public String getUsername() {
return source.getString("username");
}


}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package pw.roccodev.beezig.hiveapi.wrapper.monthly.bed;

import pw.roccodev.beezig.hiveapi.wrapper.monthly.MonthlyProfile;
import pw.roccodev.beezig.hiveapi.wrapper.monthly.PvPMonthlyProfile;
import pw.roccodev.beezig.hiveapi.wrapper.utils.json.JObject;

public class BedMonthlyProfile extends MonthlyProfile {
public class BedMonthlyProfile extends PvPMonthlyProfile {


private JObject source;
Expand All @@ -13,16 +13,6 @@ public BedMonthlyProfile(JObject source) {
this.source = source;
}

@Override
public long getPoints() {
return source.getLong("points");
}

@Override
public long getPlace() {
return source.getLong("place");
}

public long getVictories() {
return source.getLong("victories");
}
Expand All @@ -31,14 +21,6 @@ public String getUsername() {
return source.getString("name");
}

public long getKills() {
return source.getLong("kills");
}

public long getDeaths() {
return source.getLong("deaths");
}

public long getGamesPlayed() {
return source.getLong("played");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package pw.roccodev.beezig.hiveapi.wrapper.monthly.bp;

import org.json.simple.JSONObject;
import pw.roccodev.beezig.hiveapi.wrapper.monthly.MonthlyLeaderboard;
import pw.roccodev.beezig.hiveapi.wrapper.utils.json.JObject;
import pw.roccodev.beezig.hiveapi.wrapper.utils.json.LazyObject;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class BpMonthlyLeaderboard extends MonthlyLeaderboard {

private JObject source;

public BpMonthlyLeaderboard(JObject source) {
super(source);
this.source = source;
}

@Override
public List<BpMonthlyProfile> getProfiles() {
if(source instanceof LazyObject) ((LazyObject)source).fetch();

List<BpMonthlyProfile> profiles = new ArrayList<>();

JSONObject rawData = source.getInput();
for(Object profile : rawData.entrySet()) {
Map.Entry<String, JSONObject> entry = (Map.Entry<String, JSONObject>) profile;

profiles.add(new BpMonthlyProfile(new JObject(entry.getValue())));
}

return profiles;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package pw.roccodev.beezig.hiveapi.wrapper.monthly.bp;

import pw.roccodev.beezig.hiveapi.wrapper.monthly.RoccoDevMonthlyProfile;
import pw.roccodev.beezig.hiveapi.wrapper.utils.json.JObject;

public class BpMonthlyProfile extends RoccoDevMonthlyProfile {

private JObject source;

public BpMonthlyProfile(JObject source) {
super(source);
this.source = source;
}

public long getVictories() {
return source.getLong("victories");
}

public long getGamesPlayed() {
return source.getLong("played");
}

public long getPlacings() {
return source.getLong("placings");
}

public long getEliminations() {
return source.getLong("eliminations");
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package pw.roccodev.beezig.hiveapi.wrapper.monthly.cai;

import org.json.simple.JSONObject;
import pw.roccodev.beezig.hiveapi.wrapper.monthly.MonthlyLeaderboard;
import pw.roccodev.beezig.hiveapi.wrapper.utils.json.JObject;
import pw.roccodev.beezig.hiveapi.wrapper.utils.json.LazyObject;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class CaiMonthlyLeaderboard extends MonthlyLeaderboard {

private JObject source;

public CaiMonthlyLeaderboard(JObject source) {
super(source);
this.source = source;
}

@Override
public List<CaiMonthlyProfile> getProfiles() {
if(source instanceof LazyObject) ((LazyObject)source).fetch();

List<CaiMonthlyProfile> profiles = new ArrayList<>();

JSONObject rawData = source.getInput();
for(Object profile : rawData.entrySet()) {
Map.Entry<String, JSONObject> entry = (Map.Entry<String, JSONObject>) profile;

profiles.add(new CaiMonthlyProfile(new JObject(entry.getValue())));
}

return profiles;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package pw.roccodev.beezig.hiveapi.wrapper.monthly.cai;

import pw.roccodev.beezig.hiveapi.wrapper.monthly.RoccoDevMonthlyProfile;
import pw.roccodev.beezig.hiveapi.wrapper.utils.json.JObject;

public class CaiMonthlyProfile extends RoccoDevMonthlyProfile {

private JObject source;

public CaiMonthlyProfile(JObject source) {
super(source);
this.source = source;
}

public long getVictories() {
return source.getLong("victories");
}

public long getGamesPlayed() {
return source.getLong("played");
}

public long getCaptures() {
return source.getLong("captures");
}

public long getCaught() {
return source.getLong("caught");
}

}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package pw.roccodev.beezig.hiveapi.wrapper.monthly.dr;

import pw.roccodev.beezig.hiveapi.wrapper.monthly.MonthlyProfile;
import pw.roccodev.beezig.hiveapi.wrapper.monthly.PvPMonthlyProfile;
import pw.roccodev.beezig.hiveapi.wrapper.utils.json.JObject;

public class DrMonthlyProfile extends MonthlyProfile {
public class DrMonthlyProfile extends PvPMonthlyProfile {

private JObject source;

Expand All @@ -12,20 +12,6 @@ public DrMonthlyProfile(JObject source) {
this.source = source;
}

@Override
public long getPoints() {
return source.getLong("points");
}

public String getUsername() {
return source.getString("username");
}

@Override
public long getPlace() {
return source.getLong("place");
}

public long getVictories() {
return source.getLong("victories");
}
Expand All @@ -34,12 +20,4 @@ public long getGamesPlayed() {
return source.getLong("played");
}

public long getKills() {
return source.getLong("kills");
}

public long getDeaths() {
return source.getLong("deaths");
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package pw.roccodev.beezig.hiveapi.wrapper.monthly.gnt;

import org.json.simple.JSONObject;
import pw.roccodev.beezig.hiveapi.wrapper.monthly.MonthlyLeaderboard;
import pw.roccodev.beezig.hiveapi.wrapper.utils.json.JObject;
import pw.roccodev.beezig.hiveapi.wrapper.utils.json.LazyObject;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class GntMonthlyLeaderboard extends MonthlyLeaderboard {

private JObject source;

public GntMonthlyLeaderboard(JObject source) {
super(source);
this.source = source;
}

@Override
public List<GntMonthlyProfile> getProfiles() {
if(source instanceof LazyObject) ((LazyObject)source).fetch();

List<GntMonthlyProfile> profiles = new ArrayList<>();

JSONObject rawData = source.getInput();
for(Object profile : rawData.entrySet()) {
Map.Entry<String, JSONObject> entry = (Map.Entry<String, JSONObject>) profile;

profiles.add(new GntMonthlyProfile(new JObject(entry.getValue())));
}

return profiles;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package pw.roccodev.beezig.hiveapi.wrapper.monthly.gnt;

import pw.roccodev.beezig.hiveapi.wrapper.monthly.PvPMonthlyProfile;
import pw.roccodev.beezig.hiveapi.wrapper.utils.json.JObject;

public class GntMonthlyProfile extends PvPMonthlyProfile {

private JObject source;

public GntMonthlyProfile(JObject source) {
super(source);
this.source = source;
}

public long getVictories() {
return source.getLong("victories");
}

public long getGamesPlayed() {
return source.getLong("played");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package pw.roccodev.beezig.hiveapi.wrapper.monthly.gnt;

import org.json.simple.JSONObject;
import pw.roccodev.beezig.hiveapi.wrapper.utils.json.JObject;
import pw.roccodev.beezig.hiveapi.wrapper.utils.json.LazyObject;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class GntmMonthlyLeaderboard extends GntMonthlyLeaderboard {

private JObject source;

public GntmMonthlyLeaderboard(JObject source) {
super(source);
this.source = source;
}

@Override
public List<GntMonthlyProfile> getProfiles() {
if(source instanceof LazyObject) ((LazyObject)source).fetch();

List<GntMonthlyProfile> profiles = new ArrayList<>();

JSONObject rawData = source.getInput();
for(Object profile : rawData.entrySet()) {
Map.Entry<String, JSONObject> entry = (Map.Entry<String, JSONObject>) profile;

profiles.add(new GntmMonthlyProfile(new JObject(entry.getValue())));
}

return profiles;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package pw.roccodev.beezig.hiveapi.wrapper.monthly.gnt;

import pw.roccodev.beezig.hiveapi.wrapper.utils.json.JObject;

public class GntmMonthlyProfile extends GntMonthlyProfile {

public GntmMonthlyProfile(JObject source) {
super(source);
}
}
Loading

0 comments on commit dad48c6

Please sign in to comment.