package rip.tilly.bedwars.player;

import lombok.Getter;
import lombok.Setter;
import org.bukkit.entity.Player;
import rip.tilly.bedwars.BedWars;
import rip.tilly.bedwars.managers.PlayerDataManager;

import java.util.UUID;

/**
 * Created by Lucanius
 * Project: BedWars
 */
@Getter
@Setter
public class PlayerData {

    private final PlayerDataManager playerDataManager = BedWars.getInstance().getPlayerDataManager();
    private PlayerState playerState = PlayerState.SPAWN;

    private PlayerSettings playerSettings = new PlayerSettings();

    private PlayerTeam playerTeam;

    private final UUID uniqueId;
    private boolean loaded;

    private UUID currentGameId;
    private int teamId;

    private int kills;
    private int deaths;
    private double xp;
    private int level;
    private int wins;
    private int losses;
    private int gamesPlayed;

    private Player lastDamager;

    public PlayerData(UUID uniqueId) {
        this.uniqueId = uniqueId;
        this.loaded = false;

        this.playerDataManager.loadPlayerData(this);
    }
}
