#pragma once #include #include "Socket.hpp" #include "Packet.hpp" enum ConnectionState { Handshaking, Login, Play, Status, }; class Network { Socket *socket; StreamSocket *stream; std::shared_ptr ReceivePacketByPacketId(int packetId, ConnectionState state, StreamInput &stream); public: Network(std::string address, unsigned short port); ~Network(); std::shared_ptr ReceivePacket(ConnectionState state = Play); void SendPacket(Packet &packet); std::shared_ptr ParsePacketPlay(PacketNamePlayCB id); };