diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2023-03-19 10:42:54 +0100 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-03-19 10:42:54 +0100 |
| commit | 61d46a790cfde35bedf4283cbbcce06639cce1ec (patch) | |
| tree | ffdbda2cb8fc4e47144aa25458e8191488cea478 /src/character.cpp | |
| parent | b93313e438c7b943e506f3c16675e5d38edd0537 (diff) | |
src/entity: move type data member to vtable
Diffstat (limited to 'src/character.cpp')
| -rw-r--r-- | src/character.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/character.cpp b/src/character.cpp index 31376925..51c243c2 100644 --- a/src/character.cpp +++ b/src/character.cpp @@ -54,7 +54,6 @@ constexpr auto arrows_to_dir(bool L, bool R, bool U, bool D) character_proto::character_proto(const character_proto&) = default; character_proto::~character_proto() noexcept = default; character_proto& character_proto::operator=(const character_proto&) = default; -character::~character() = default; character_proto::character_proto() { @@ -132,6 +131,8 @@ bool character::update(size_t i, float dt) return true; } +entity_type character::type() const noexcept { return entity_type::character; } + character::operator character_proto() const { character_proto ret; @@ -141,8 +142,8 @@ character::operator character_proto() const return ret; } -character::character(object_id id, struct chunk& c, entity_type type, const character_proto& proto) : - entity{id, c, type, proto}, +character::character(object_id id, struct chunk& c, const character_proto& proto) : + entity{id, c, proto}, name{proto.name}, playable{proto.playable} { |
