TnxSim namespace

Classes

struct CommandField
struct CommandInfo
struct CommandValue
A field's value by name, for BuildCommand.

Enums

enum class CommandFieldKind: uint8_t { Float, Double, Signed, Unsigned, Bool, Fixed }

Functions

auto CommandIDOf(std::string_view name) -> uint32_t constexpr
A command's type ID: FNV-1a of its name.
auto SendBytes(WorldBase& world, uint32_t type, const void* bytes, uint8_t size) -> bool
Queue bytes as a command of type from world's local player. False if the queue is full.
template<SimCommand T>
auto Send(WorldBase& world, const T& command) -> bool
Send command from the local player of world. Any thread. False if the queue is full.
void RegisterCommand(CommandInfo info)
auto FindCommand(std::string_view name) -> const CommandInfo*
Null if no command of that name is registered.
auto Commands() -> const std::vector<CommandInfo>&
Every registered command.
auto BuildCommand(const CommandInfo& info, std::span<const CommandValue> values, uint8_t* out, std::string& why) -> bool
template<typename TField>
auto KindOf(CommandFieldKind& kind) -> bool constexpr
template<SimCommand T>
auto DescribeCommand() -> CommandInfo