package Übungen.MychatGUI;

public class User {

    private String user_name;
    private int id;
    private static int ID = 1;
    private Status status;

    public User(String user_name) {
        this.user_name = user_name;
        this.id = ID++;
        this.status = Status.OFFLINE; // Standardmäßig offline
    }

    public String getUser_name() {
        return user_name;
    }

    public void setUser_name(String user_name) {
        this.user_name = user_name;
    }

    public int getId() {
        return id;
    }

    public Status getStatus() {
        return status;
    }

    public void setStatus(Status status) {
        this.status = status;
    }

    @Override
    public String toString() {
        return "User [user_name=" + user_name + ", id=" + id + ", status=" + status.getDescription() + "]";
    }

    // Enum für Status
    public enum Status {
        ONLINE("Online"),
        OFFLINE("Offline"),
        NICHT_STOEREN("Nicht Stören");

        private String description;

        // Konstruktor für enum
        Status(String description) {
            this.description = description;
        }

        // Methode, um die Beschreibung zu holen
        public String getDescription() {
            return description;
        }
    }
}
