Skip to content

Commit

Permalink
docs(tesseratos): comparing asset types
Browse files Browse the repository at this point in the history
  • Loading branch information
roby2014 committed Nov 12, 2023
1 parent ca5d6fb commit 93d3654
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion tools/tesseratos/src/tesseratos/scene_editor/plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

#include <cubos/core/data/old/debug_serializer.hpp>
#include <cubos/core/ecs/system/commands.hpp>
#include <cubos/core/reflection/reflect.hpp>
#include <cubos/core/reflection/type.hpp>

#include <cubos/engine/assets/plugin.hpp>
#include <cubos/engine/imgui/plugin.hpp>
Expand Down Expand Up @@ -96,7 +98,7 @@ static void checkAssetEventSystem(cubos::core::ecs::EventReader<AssetSelectedEve
{
for (const auto& event : reader)
{
if (assets->type(event.asset) == typeid(Scene))
if (assets->type(event.asset).is<Scene>())
{
CUBOS_INFO("Opening scene {}", Debug(event.asset));
openScene(event.asset, commands, *assets, *scene);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <cubos/core/data/old/debug_serializer.hpp>
#include <cubos/core/log.hpp>
#include <cubos/core/reflection/type.hpp>

#include <cubos/engine/imgui/plugin.hpp>
#include <cubos/engine/renderer/plugin.hpp>
Expand Down Expand Up @@ -92,7 +93,7 @@ static void checkAssetEventSystem(EventReader<AssetSelectedEvent> reader, Write<
{
for (const auto& event : reader)
{
if (assets->type(event.asset) == typeid(VoxelPalette))
if (assets->type(event.asset).is<VoxelPalette>())
{
CUBOS_INFO("Opening palette asset {}", Debug(event.asset));
if (!selectedPalette->asset.isNull() && selectedPalette->modified)
Expand Down

0 comments on commit 93d3654

Please sign in to comment.