Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.bapcraft.got.player;
- import java.io.File;
- import java.util.UUID;
- import com.bapcraft.got.BapGot;
- import com.google.gson.annotations.Expose;
- public class GotPlayer {
- @Expose public UUID uuid;
- /** If you're there when it starts. */
- @Expose public int gamesPlayed;
- /** If you die too many times or lose outright. */
- @Expose public int gamesLost;
- /** If you get to the throne and complete the objectives. */
- @Expose public int gamesWon;
- /** If you win it because someone else in your family gets to the throne. */
- @Expose public int gamesWonWithFamily;
- /** In-game currency, persists between rounds. */
- @Expose public long gold;
- public GotPlayer(UUID uuid) {
- this.uuid = uuid;
- }
- public GotPlayer() {
- // For Gson.
- }
- public int getGamesWonOverall() {
- return this.gamesWon + this.gamesWonWithFamily;
- }
- public int getGamesCompleted() {
- return this.gamesWon + this.gamesWonWithFamily + this.gamesLost;
- }
- public void flush() {
- PlayerIO.savePlayerData_deferred(this);
- }
- public File getDataFile() {
- return getDataFile(this.uuid);
- }
- public static File getDataFile(UUID uuid) {
- return new File(new File(BapGot.INSTANCE.getDataFolder(), "playerdata"), "player-data_" + uuid.toString() + ".json");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement