-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add meta context visitor test utility
- Loading branch information
1 parent
958e73f
commit 05b8061
Showing
2 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
modules/core/test/testutil/meta_context_visitor_tester.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// Copyright (C) 2023 Albin Johansson (GNU General Public License v3.0) | ||
|
||
#pragma once | ||
|
||
#include "tactile/core/context/meta_context_visitor.hpp" | ||
|
||
namespace tactile::testutil { | ||
|
||
class MetaContextVisitorTester final : public IMetaContextVisitor { | ||
public: | ||
int orthogonal_map_count {0}; | ||
int isometric_map_count {0}; | ||
int hexagonal_map_count {0}; | ||
int group_layer_count {0}; | ||
int tile_layer_count {0}; | ||
int object_layer_count {0}; | ||
int object_count {0}; | ||
int tileset_count {0}; | ||
int tile_count {0}; | ||
|
||
void visit([[maybe_unused]] OrthogonalMap& map) override | ||
{ | ||
++orthogonal_map_count; | ||
} | ||
|
||
void visit([[maybe_unused]] IsometricMap& map) override | ||
{ | ||
++isometric_map_count; | ||
} | ||
|
||
void visit([[maybe_unused]] HexagonalMap& map) override | ||
{ | ||
++hexagonal_map_count; | ||
} | ||
|
||
void visit([[maybe_unused]] GroupLayer& layer) override | ||
{ | ||
++group_layer_count; | ||
} | ||
|
||
void visit([[maybe_unused]] TileLayer& layer) override | ||
{ | ||
++tile_layer_count; | ||
} | ||
|
||
void visit([[maybe_unused]] ObjectLayer& layer) override | ||
{ | ||
++object_layer_count; | ||
} | ||
|
||
void visit([[maybe_unused]] Object& object) override | ||
{ | ||
++object_count; | ||
} | ||
|
||
void visit([[maybe_unused]] Tileset& tileset) override | ||
{ | ||
++tileset_count; | ||
} | ||
|
||
void visit([[maybe_unused]] Tile& tile) override | ||
{ | ||
++tile_count; | ||
} | ||
}; | ||
|
||
} // namespace tactile::testutil |