Skip to content

Commit 7a17e64

Browse files
committed
monthly: GRAV, DRAW, BD, CR, SP
1 parent 562bd5b commit 7a17e64

16 files changed

+474
-9
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package eu.beezig.hiveapi.wrapper.monthly.bd;
2+
3+
import eu.beezig.hiveapi.wrapper.monthly.MonthlyLeaderboard;
4+
import eu.beezig.hiveapi.wrapper.utils.json.JObject;
5+
import org.json.simple.JSONObject;
6+
7+
import java.util.ArrayList;
8+
import java.util.List;
9+
import java.util.Map;
10+
11+
public class BdMonthlyLeaderboard extends MonthlyLeaderboard {
12+
13+
private JObject source;
14+
15+
public BdMonthlyLeaderboard(JObject source) {
16+
super(source);
17+
this.source = source;
18+
}
19+
20+
@Override
21+
public List<BdMonthlyProfile> getProfiles() {
22+
List<BdMonthlyProfile> profiles = new ArrayList<>();
23+
JSONObject rawData = source.getInput();
24+
for(Object profile : rawData.entrySet()) {
25+
Map.Entry<String, JSONObject> entry = (Map.Entry<String, JSONObject>) profile;
26+
profiles.add(new BdMonthlyProfile(new JObject(entry.getValue())));
27+
}
28+
return profiles;
29+
}
30+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package eu.beezig.hiveapi.wrapper.monthly.bd;
2+
3+
import eu.beezig.hiveapi.wrapper.monthly.RoccoDevMonthlyProfile;
4+
import eu.beezig.hiveapi.wrapper.utils.json.JObject;
5+
6+
public class BdMonthlyProfile extends RoccoDevMonthlyProfile {
7+
private JObject source;
8+
9+
public BdMonthlyProfile(JObject source) {
10+
super(source);
11+
this.source = source;
12+
}
13+
14+
public long getVictories() {
15+
return source.getLong("victories");
16+
}
17+
18+
public long getKills() {
19+
return source.getLong("kills");
20+
}
21+
22+
public long getDeaths() {
23+
return source.getLong("deaths");
24+
}
25+
26+
public long getGamesPlayed() {
27+
return source.getLong("played");
28+
}
29+
30+
public long getEnergyCollected() {
31+
return source.getLong("energy");
32+
}
33+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package eu.beezig.hiveapi.wrapper.monthly.cr;
2+
3+
import eu.beezig.hiveapi.wrapper.monthly.MonthlyLeaderboard;
4+
import eu.beezig.hiveapi.wrapper.utils.json.JObject;
5+
import org.json.simple.JSONObject;
6+
7+
import java.util.ArrayList;
8+
import java.util.List;
9+
import java.util.Map;
10+
11+
public class CrMonthlyLeaderboard extends MonthlyLeaderboard {
12+
13+
private JObject source;
14+
15+
public CrMonthlyLeaderboard(JObject source) {
16+
super(source);
17+
this.source = source;
18+
}
19+
20+
@Override
21+
public List<CrMonthlyProfile> getProfiles() {
22+
List<CrMonthlyProfile> profiles = new ArrayList<>();
23+
JSONObject rawData = source.getInput();
24+
for(Object profile : rawData.entrySet()) {
25+
Map.Entry<String, JSONObject> entry = (Map.Entry<String, JSONObject>) profile;
26+
profiles.add(new CrMonthlyProfile(new JObject(entry.getValue())));
27+
}
28+
return profiles;
29+
}
30+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package eu.beezig.hiveapi.wrapper.monthly.cr;
2+
3+
import eu.beezig.hiveapi.wrapper.monthly.RoccoDevMonthlyProfile;
4+
import eu.beezig.hiveapi.wrapper.utils.json.JObject;
5+
6+
public class CrMonthlyProfile extends RoccoDevMonthlyProfile {
7+
private JObject source;
8+
9+
public CrMonthlyProfile(JObject source) {
10+
super(source);
11+
this.source = source;
12+
}
13+
14+
public long getVictories() {
15+
return source.getLong("victories");
16+
}
17+
18+
public long getKills() {
19+
return source.getLong("kills");
20+
}
21+
22+
public long getDeaths() {
23+
return source.getLong("deaths");
24+
}
25+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package eu.beezig.hiveapi.wrapper.monthly.draw;
2+
3+
import eu.beezig.hiveapi.wrapper.monthly.MonthlyLeaderboard;
4+
import eu.beezig.hiveapi.wrapper.utils.json.JObject;
5+
import org.json.simple.JSONObject;
6+
7+
import java.util.ArrayList;
8+
import java.util.List;
9+
import java.util.Map;
10+
11+
public class DrawMonthlyLeaderboard extends MonthlyLeaderboard {
12+
13+
private JObject source;
14+
15+
public DrawMonthlyLeaderboard(JObject source) {
16+
super(source);
17+
this.source = source;
18+
}
19+
20+
@Override
21+
public List<DrawMonthlyProfile> getProfiles() {
22+
List<DrawMonthlyProfile> profiles = new ArrayList<>();
23+
JSONObject rawData = source.getInput();
24+
for(Object profile : rawData.entrySet()) {
25+
Map.Entry<String, JSONObject> entry = (Map.Entry<String, JSONObject>) profile;
26+
profiles.add(new DrawMonthlyProfile(new JObject(entry.getValue())));
27+
}
28+
return profiles;
29+
}
30+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package eu.beezig.hiveapi.wrapper.monthly.draw;
2+
3+
import eu.beezig.hiveapi.wrapper.monthly.RoccoDevMonthlyProfile;
4+
import eu.beezig.hiveapi.wrapper.utils.json.JObject;
5+
6+
public class DrawMonthlyProfile extends RoccoDevMonthlyProfile {
7+
private JObject source;
8+
9+
public DrawMonthlyProfile(JObject source) {
10+
super(source);
11+
this.source = source;
12+
}
13+
14+
public long getVictories() {
15+
return source.getLong("victories");
16+
}
17+
18+
public long getGamesPlayed() {
19+
return source.getLong("played");
20+
}
21+
22+
public long getCorrectGuesses() {
23+
return source.getLong("correct");
24+
}
25+
26+
public long getIncorrectGuesses() {
27+
return source.getLong("incorrect");
28+
}
29+
30+
public long getSkips() {
31+
return source.getLong("skips");
32+
}
33+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package eu.beezig.hiveapi.wrapper.monthly.grav;
2+
3+
import eu.beezig.hiveapi.wrapper.monthly.MonthlyLeaderboard;
4+
import eu.beezig.hiveapi.wrapper.utils.json.JObject;
5+
import org.json.simple.JSONObject;
6+
7+
import java.util.ArrayList;
8+
import java.util.List;
9+
import java.util.Map;
10+
11+
public class GravMonthlyLeaderboard extends MonthlyLeaderboard {
12+
13+
private JObject source;
14+
15+
public GravMonthlyLeaderboard(JObject source) {
16+
super(source);
17+
this.source = source;
18+
}
19+
20+
@Override
21+
public List<GravMonthlyProfile> getProfiles() {
22+
List<GravMonthlyProfile> profiles = new ArrayList<>();
23+
JSONObject rawData = source.getInput();
24+
for(Object profile : rawData.entrySet()) {
25+
Map.Entry<String, JSONObject> entry = (Map.Entry<String, JSONObject>) profile;
26+
profiles.add(new GravMonthlyProfile(new JObject(entry.getValue())));
27+
}
28+
return profiles;
29+
}
30+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package eu.beezig.hiveapi.wrapper.monthly.grav;
2+
3+
import eu.beezig.hiveapi.wrapper.monthly.RoccoDevMonthlyProfile;
4+
import eu.beezig.hiveapi.wrapper.utils.json.JObject;
5+
6+
public class GravMonthlyProfile extends RoccoDevMonthlyProfile {
7+
private JObject source;
8+
9+
public GravMonthlyProfile(JObject source) {
10+
super(source);
11+
this.source = source;
12+
}
13+
14+
public long getVictories() {
15+
return source.getLong("victories");
16+
}
17+
18+
public long getGamesPlayed() {
19+
return source.getLong("played");
20+
}
21+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package eu.beezig.hiveapi.wrapper.monthly.sp;
2+
3+
import eu.beezig.hiveapi.wrapper.monthly.MonthlyLeaderboard;
4+
import eu.beezig.hiveapi.wrapper.utils.json.JObject;
5+
import org.json.simple.JSONObject;
6+
7+
import java.util.ArrayList;
8+
import java.util.List;
9+
import java.util.Map;
10+
11+
public class SpMonthlyLeaderboard extends MonthlyLeaderboard {
12+
13+
private JObject source;
14+
15+
public SpMonthlyLeaderboard(JObject source) {
16+
super(source);
17+
this.source = source;
18+
}
19+
20+
@Override
21+
public List<SpMonthlyProfile> getProfiles() {
22+
List<SpMonthlyProfile> profiles = new ArrayList<>();
23+
JSONObject rawData = source.getInput();
24+
for(Object profile : rawData.entrySet()) {
25+
Map.Entry<String, JSONObject> entry = (Map.Entry<String, JSONObject>) profile;
26+
profiles.add(new SpMonthlyProfile(new JObject(entry.getValue())));
27+
}
28+
return profiles;
29+
}
30+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package eu.beezig.hiveapi.wrapper.monthly.sp;
2+
3+
import eu.beezig.hiveapi.wrapper.monthly.RoccoDevMonthlyProfile;
4+
import eu.beezig.hiveapi.wrapper.utils.json.JObject;
5+
6+
public class SpMonthlyProfile extends RoccoDevMonthlyProfile {
7+
private JObject source;
8+
9+
public SpMonthlyProfile(JObject source) {
10+
super(source);
11+
this.source = source;
12+
}
13+
14+
public long getVictories() {
15+
return source.getLong("victories");
16+
}
17+
18+
public long getGamesPlayed() {
19+
return source.getLong("played");
20+
}
21+
22+
public long getEggsThrown() {
23+
return source.getLong("eggs");
24+
}
25+
26+
public long getDeaths() {
27+
return source.getLong("deaths");
28+
}
29+
30+
public long getBlocksDestroyed() {
31+
return source.getLong("blocks");
32+
}
33+
}

0 commit comments

Comments
 (0)