summaryrefslogtreecommitdiffhomepage
path: root/editor
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-03-19 10:42:54 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-03-19 10:42:54 +0100
commit61d46a790cfde35bedf4283cbbcce06639cce1ec (patch)
treeffdbda2cb8fc4e47144aa25458e8191488cea478 /editor
parentb93313e438c7b943e506f3c16675e5d38edd0537 (diff)
src/entity: move type data member to vtable
Diffstat (limited to 'editor')
-rw-r--r--editor/app.cpp4
-rw-r--r--editor/imgui-inspect.cpp2
-rw-r--r--editor/scenery-editor.cpp2
3 files changed, 4 insertions, 4 deletions
diff --git a/editor/app.cpp b/editor/app.cpp
index 71b34cb8..89f9ccf6 100644
--- a/editor/app.cpp
+++ b/editor/app.cpp
@@ -46,7 +46,7 @@ void app::reset_world()
void app::ensure_player_character(world& w)
{
if (_character_id)
- if (auto C = w.find_entity(_character_id); C && C->type == entity_type::character)
+ if (auto C = w.find_entity(_character_id); C && C->type() == entity_type::character)
return;
_character_id = 0;
@@ -57,7 +57,7 @@ void app::ensure_player_character(world& w)
for (const auto& e_ : c.entities())
{
const auto& e = *e_;
- if (e.type == entity_type::character)
+ if (e.type() == entity_type::character)
{
const auto& C = static_cast<const character&>(e);
if (C.playable)
diff --git a/editor/imgui-inspect.cpp b/editor/imgui-inspect.cpp
index 45b42b7b..7ef24913 100644
--- a/editor/imgui-inspect.cpp
+++ b/editor/imgui-inspect.cpp
@@ -42,7 +42,7 @@ void app::draw_inspector()
snformat(buf, "{} ({}x{} -> {}x{})"_cf, name, ch.x, ch.y, (int)pos.x, (int)pos.y);
bool is_open = true;
- if (s.type == entity_type::scenery)
+ if (s.type() == entity_type::scenery)
{
auto& s2 = static_cast<scenery&>(s);
if (auto b2 = begin_window(buf, &is_open))
diff --git a/editor/scenery-editor.cpp b/editor/scenery-editor.cpp
index 562ca04f..fd859db3 100644
--- a/editor/scenery-editor.cpp
+++ b/editor/scenery-editor.cpp
@@ -87,7 +87,7 @@ void scenery_editor::place_tile(world& w, global_coords pos, const scenery_& s)
for (auto i = es.size()-1; i != (size_t)-1; i--)
{
const auto& e = *es[i];
- if (e.type != entity_type::scenery)
+ if (e.type() != entity_type::scenery)
continue;
auto center = Vector2(e.coord.local())*TILE_SIZE2 + Vector2(e.offset) + Vector2(e.bbox_offset),
min = center - Vector2(e.bbox_size/2), max = min + Vector2(e.bbox_size);