@startuml
title TeamTalk | Klassendiagramm

class Client {
    main()
}

class Server {
    main()
}

class ClientGUI {
    --
    create(chatClient: ChatClient)
}

class ServerGUI {
    --
    create()
}

class ChatClient {
    +ChatClient() : Communicable
    -clientSocket: Socket
    -clientCoroutine: ClientCoroutine
    -uuid: UUID
    -username: String
    --
    +start()
    +stop()
    +getUsername(): String
    +getCoroutine(): ClientCoroutine
    +getUUID(): UUID
    +sendMessage(message: String, receiver: ChatClient)
    +sendFile(file: File, receiver: ChatClient)
}

class ClientCoroutine {
    +ClientCoroutine(chatClient: ChatClient)
    -chatClient: ChatClient
    --
    +run()
    +getClient(): ChatClient
}

class ChatServer {
    +ChatServer(IP, PORT) : Communicable
    -IP: InetAddress
    -PORT: Int
    -clients: List<ChatClient>
    --
    +start()
    +stop()
}

class ServerCoroutine {
    +ServerCoroutine()
    --
    +run()
}

interface Communicable {
    start()
    stop()
}

enum CoroutineType {
    SERVER_BASE
    SERVER_CLIENT
    CLIENT
}

enum ViewType {
    PRE_VIEW
    BASE_VIEW
    CONFIG_VIEW
}

ChatClient -[dashed]-|> Communicable
ChatServer -[dashed]-|> Communicable
ChatServer "0..n" -> ChatClient
ChatClient -> ClientCoroutine
ChatServer -> ServerCoroutine

@enduml