|
|
Bomberman Multiplayer
Authoritative multiplayer networking layer for Bomberman.
|
Fixed-size message type to handler lookup table. More...
#include <PacketDispatch.h>
Public Member Functions | |
| void | bind (EMsgType type, PacketHandlerFn< TContext > fn) |
| Registers a handler for a message type. Overwrites existing binding. | |
| bool | dispatch (TContext &context, const PacketHeader &header, const uint8_t *payload, std::size_t payloadSize) const |
Looks up and invokes the handler for header.type. | |
Public Attributes | |
| std::array< PacketHandlerFn< TContext >, kTableSize > | table {} |
Static Public Attributes | |
| static constexpr std::size_t | kTableSize = 256 |
Fixed-size message type to handler lookup table.
| TContext | Context type shared by all bound handlers. |
Indexes by raw uint8_t message type. Unbound slots are nullptr.
|
inline |
Looks up and invokes the handler for header.type.
true if a handler was found and called.