#pragma once

#include <SDL_net.h>
#include <string>

class Client;

#include "ClientStates.h"


class Client {
    public:
    Client(std::string serverIP, int port);
    ~Client();
    
    Client(const Client&) = delete;

    void setClientState(ClientState *state);

    void update(unsigned int delta);


    bool sendConnectionRequest(IPaddress dest);
    bool sendPacket(UDPpacket &packet);

    UDPsocket udpSocket;
    IPaddress serverIP;

    UDPpacket *connectionRequest;
    UDPpacket *receivedPacket;

    ClientState *currentState;

    Connected *connected;
    Connecting *connecting;
    Disconnected *disconnected;
};