Jazz2::Multiplayer::ServerMessage struct

Message of the server with its arguments, see ServerMessageType.

Public static variables

static std::uint32_t MaxArgs constexpr
Maximum number of arguments.

Constructors, destructors, conversion operators

ServerMessage()
template<class ... TArgs>
ServerMessage(ServerMessageType type, TArgs && ... args) explicit
Creates a message with the specified arguments.

Public functions

auto GetText(std::size_t index) const -> StringView
Returns the text argument, or an empty string if it's not a text.
auto GetNumber(std::size_t index) const -> std::int32_t
Returns the number argument, or.
auto GetTeam(std::size_t index) const -> std::uint8_t
Returns the team argument, or.

Public variables

ServerMessageType Type
Type.
SmallVector<ServerMessageArg, 3> Args
Arguments.

Function documentation

std::int32_t Jazz2::Multiplayer::ServerMessage::GetNumber(std::size_t index) const

Returns the number argument, or.

0 if it's not a number

std::uint8_t Jazz2::Multiplayer::ServerMessage::GetTeam(std::size_t index) const

Returns the team argument, or.

UINT8_MAX if it's not a team