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.
To make this easier to parse, maybe it should be get_output(empty_fallback(misc_get_entity_name_upper(entity), entity->id), true, true)
instead. That way clients can always safely Base64 decode without having to check if it's just an ID. Also empty_fallback
could probably be merged into get_output
as an empty_fallback
parameter.
What was the reasoning behind using a custom structure instead of something like the standard std::queue
or std::vector
?
This should be static
.
This is never called with a non-player sender
. The type should be changed to Player *
. That way, you can get rid of the isPlayer()
check and the various (Player *)
casts. (Yes, I know I'm contradicting past-me. Past-me was an idiot.)