Skip to content
Snippets Groups Projects
Select Git revision
  • a0e8ea223e2663a9628e38da8258e9179a7c7b98
  • master default protected
2 results

Player.java

Blame
  • Player.java 2.16 KiB
    package com.slprojects.democultureconceptsinfo;
    
    import java.time.LocalDateTime;
    import java.util.UUID;
    
    public class Player {
        private final UUID uuid;
        private final String username;
        private long playTime; // en secondes
        private final LocalDateTime registrationDate;
        private LocalDateTime lastConnectionDate;
        private double balance;
        private Coordinates coordinates;
    
        public Player(UUID uuid, String username, long playTime, LocalDateTime registrationDate, LocalDateTime lastConnectionDate, double balance, Coordinates coordinates) {
            this.uuid = uuid;
            this.username = username;
            this.playTime = playTime;
            this.registrationDate = registrationDate;
            this.lastConnectionDate = lastConnectionDate;
            this.balance = balance;
            this.coordinates = coordinates;
        }
    
        public UUID getUuid() {
            return uuid;
        }
    
        public String getUsername() {
            return username;
        }
    
        public long getPlayTime() {
            return playTime;
        }
    
        public LocalDateTime getRegistrationDate() {
            return registrationDate;
        }
    
        public LocalDateTime getLastConnectionDate() {
            return lastConnectionDate;
        }
    
        public double getBalance() {
            return balance;
        }
    
        public Coordinates getCoordinates() {
            return coordinates;
        }
    
        public void incrementPlayTime(long playTime) {
            this.playTime += playTime;
        }
    
        public void setLastConnectionDate(LocalDateTime lastConnectionDate) {
            this.lastConnectionDate = lastConnectionDate;
        }
    
        public void setBalance(double balance) {
            this.balance = balance;
        }
    
        public void setCoordinates(Coordinates coordinates) {
            this.coordinates = coordinates;
        }
    
        @Override
        public String toString() {
            return "Player{" +
                    "uuid=" + uuid +
                    ", username='" + username + '\'' +
                    ", playTime=" + playTime +
                    ", registrationDate=" + registrationDate +
                    ", lastConnectionDate=" + lastConnectionDate +
                    ", balance=" + balance +
                    ", coordinates=" + coordinates +
                    '}';
        }
    }