summaryrefslogtreecommitdiffhomepage
path: root/editor/tests.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-10-20 04:20:51 +0200
committerStanislaw Halik <sthalik@misaki.pl>2023-10-20 04:20:51 +0200
commit9099eec2a638bcf61bf46e86740458d933197577 (patch)
treedca1ae5c0f8fc89ebf55624b2988733d094af3bc /editor/tests.cpp
parente8a7d188eb186204dc8d8e25aa732e14fac96594 (diff)
wip tests
Diffstat (limited to 'editor/tests.cpp')
-rw-r--r--editor/tests.cpp90
1 files changed, 90 insertions, 0 deletions
diff --git a/editor/tests.cpp b/editor/tests.cpp
new file mode 100644
index 00000000..52b52aa0
--- /dev/null
+++ b/editor/tests.cpp
@@ -0,0 +1,90 @@
+#include "tests-private.hpp"
+#include "app.hpp"
+#include "floormat/events.hpp"
+#include "imgui-raii.hpp"
+
+namespace floormat {
+
+using namespace floormat::tests;
+using namespace floormat::imgui;
+
+tests_data_::~tests_data_() noexcept = default;
+tests_data_::tests_data_() = default;
+
+tests_data::~tests_data() noexcept = default;
+tests_data::tests_data() = default;
+
+Pointer<tests_data_> tests_data_::make()
+{
+ return Pointer<tests_data>{InPlaceInit};
+}
+
+void app::tests_pre_update()
+{
+}
+
+void app::tests_post_update()
+{
+}
+
+bool app::tests_handle_mouse_click(const mouse_button_event& e)
+{
+ update_cursor_tile(cursor.pixel);
+ auto& var = tests();
+
+ if (e.button == mouse_button_left)
+ {
+ std::visit(overloaded {
+ [](std::monostate) {},
+ [&](path_test& t) {
+ // todo
+ }
+ }, var.data);
+
+ return true;
+ }
+ else if (e.button == mouse_button_right)
+ {
+ bool ret = false;
+ std::visit(overloaded {
+ [](std::monostate) {},
+ [&](path_test& t) {
+ ret = t.active;
+ t = {};
+ },
+ }, var.data);
+ return ret;
+ }
+ return false;
+}
+
+bool app::tests_handle_key(const key_event& e)
+{
+ return false;
+}
+
+bool app::tests_handle_mouse_move(const mouse_move_event& e)
+{
+ return false;
+}
+
+tests_data& app::tests()
+{
+ return static_cast<tests_data&>(*_tests);
+}
+
+void app::tests_reset_mode()
+{
+ if (!std::holds_alternative<std::monostate>(tests().data))
+ tests().data = std::monostate{};
+}
+
+void app::draw_tests_pane(float main_menu_height)
+{
+}
+
+void app::draw_tests_overlay()
+{
+}
+
+} // namespace floormat