aboutsummaryrefslogtreecommitdiff
path: root/src/event.rs
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2020-04-27 16:05:17 +0200
committerDaniel Schadt <kingdread@gmx.de>2020-04-27 16:05:17 +0200
commit0d4677dbd830fec0ccc3ebc33d438783dc9d4912 (patch)
tree38a90f611b09212d112323f287c7ec38f0f1f412 /src/event.rs
parent7af05afb2cf80af097fd034fef0fcdaeb399eb6d (diff)
downloadevtclib-0d4677dbd830fec0ccc3ebc33d438783dc9d4912.tar.gz
evtclib-0d4677dbd830fec0ccc3ebc33d438783dc9d4912.tar.bz2
evtclib-0d4677dbd830fec0ccc3ebc33d438783dc9d4912.zip
rework Log::players/npcs
Since we know that we're only returning Agents which are Players, we can save downstream users some time and also provide access to the &Player. Ideally, we'd want something like PlayerAgent, or Agent<Player>, but that not only incurrs code duplication (in the first case), it'd also mean cloning the player data (second case), as we couldn't just return a reference into the pool with all agents. For now, this is still the better option, until other ways have been explored. Maybe cloning here wouldn't be too bad, but we'd also run into the issue that we cannot use record unpacking for records that have different generic parameters, so going from Agent<AgentKind> to Agent<Player> would mean manually copying over all record fields. We now no longer need the matches! macro, as we can simply use AgentKind::as_{player,character}.
Diffstat (limited to 'src/event.rs')
0 files changed, 0 insertions, 0 deletions