There could even be a helper method for mobs where the API name is just an upper-cased friendly name:
static std::pair<std::string, std::string> format_entity_name(const std::string…
I mentioned this already in the Discord, but this should be changed to std::map<int, std::pair<std::string, std::string>>
to accommodate for RJ's entity type names.
Also, the fallback for this should just be UNKNOWN
since entity type ID has already been sent.
It might be easier to do std::vector
, for polling just do:
for (const type &event : list) {
if (id == -1
When compatibility mode is disabled, `
When in compat-mode, this should be put though the type ID map.
Same here, in compat mode it should only return types in the mapping table.
This should be char
instead of auto
.
Same as to_cp437
, this needs to be freed.
Why not just use the float
version of from
@ 0x27c64
?
to_cp437
has to be freed, so maybe:
cleared
or removed
would probably be a better name IMO. invalid
makes me think the event has bad values.
Why not do char lines[4][100]
rather than char l1[100], l2[100], l3[100], l4[100]; char *lines[4] = {l1, l2, l3, l4}
?
If the mapping table doesn't contain the ID, it should probably just fail. Otherwise the behavior is pretty unpredictable.
On one hand, all entity names are plain/safe ASCII. But on the other hand, it would be more consistent to Base64-encode them. You decide.
Maybe iterating through the tile events should be a helper method like iterate_tile_events(const std::function<void(EventList_TileEvent &)> &callback)
?
Base64-ing the XYZ data probably isn't necessary, why not move to get_output
to ChatEvent::toString
and ProjectileEvent::toString
. That way they're consistent with other API calls where only text is Base64-ed.