4#include <nlohmann/json_fwd.hpp>
47 .
prefix =
static_cast<uint8_t
>((unit >> 24) & 0xFF),
48 .numerator =
static_cast<uint8_t
>((unit >> 16) & 0xFF),
49 .denominator =
static_cast<uint8_t
>((unit >> 8) & 0xFF),
50 .reserved =
static_cast<uint8_t
>(unit & 0xFF),
66std::string
esiUnitSymbol(uint32_t unit, std::span<const UnitType> local = {});
69void to_json(nlohmann::json& j,
const UnitType& unit);
void to_json(nlohmann::json &j, const EniNetwork &network)
Serialises a network as JSON, for a client that renders rather than replays it.
Definition eni.cc:907
std::string esiUnitSymbol(uint32_t unit, std::span< const UnitType > local)
Renders a packed unit notation value as a display symbol.
Definition esi_unit.cc:128
constexpr UnitParts esiUnitParts(uint32_t unit)
Splits a packed ETG.1004 unit notation value into its four bytes.
Definition esi_unit.h:45
One entry of the built-in ETG.1004 notation catalogue.
Definition esi_unit.h:25
uint8_t notationIndex
Definition esi_unit.h:26
std::string_view symbol
Definition esi_unit.h:27
std::string_view name
Definition esi_unit.h:28
The four bytes of an ETG.1004 unit notation value, split out.
Definition esi_unit.h:37
uint8_t reserved
Definition esi_unit.h:41
uint8_t numerator
Definition esi_unit.h:39
uint8_t prefix
Definition esi_unit.h:38
uint8_t denominator
Definition esi_unit.h:40
A dictionary-local unit definition (ETG.2000 UnitType, Dictionary/UnitTypes).
Definition esi_unit.h:17
std::string name
Human-readable name, e.g. "Increments".
Definition esi_unit.h:20
uint32_t index
Object index of the unit in the 0x0400.. area (informational).
Definition esi_unit.h:19
uint8_t notationIndex
The byte this definition overrides.
Definition esi_unit.h:18
std::string symbol
Rendered symbol, e.g. "Inc".
Definition esi_unit.h:21