#pragma once

#include <blitz/protocol/PacketVisitor.h>

namespace blitz {

class NetworkInterface;

namespace protocol {

#define DeclarePacket(PacketName, Reliability, ...) void Visit(const protocol::packets::PacketName& a_Packet) override;





///////////////////////
/* PacketBroadcaster */
///////////////////////
class PacketBroadcaster : public protocol::PacketVisitor {
  private:
	NetworkInterface& m_NetworkInterface;

  public:
	PacketBroadcaster(NetworkInterface& a_NetworkInterface) : m_NetworkInterface(a_NetworkInterface) {}

	void BroadcastPacket(const protocol::Packet& a_Packet) {
		Check(a_Packet);
	}

	DeclareAllPacket()
};






//////////////////
/* PacketSender */
//////////////////
class PacketSender : public protocol::PacketVisitor {
  private:
	NetworkInterface& m_NetworkInterface;
	PeerID m_PeerId;

  public:
	PacketSender(PeerID a_PeerId, NetworkInterface& a_NetworkInterface) : m_PeerId(a_PeerId), m_NetworkInterface(a_NetworkInterface) {}

	void SendPacket(const protocol::Packet& a_Packet) {
		Check(a_Packet);
	}

	DeclareAllPacket()
};

#undef DeclarePacket

}  // namespace protocol
}  // namespace blitz
