From 0d432961a29d509cd0d1fa80361f04009dcf9c17 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 19 Mar 2025 03:19:38 +0000 Subject: Remove lots of stuff not required or superseded with ImGui use --- ui/modeHelper.h | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 ui/modeHelper.h (limited to 'ui/modeHelper.h') diff --git a/ui/modeHelper.h b/ui/modeHelper.h deleted file mode 100644 index d20f2db..0000000 --- a/ui/modeHelper.h +++ /dev/null @@ -1,40 +0,0 @@ -#pragma once - -#include -union SDL_Event; - -enum ModeSecondClick { Unset, Reset, NoAction }; - -template class Mode { -public: - explicit Mode(Target & t) : target {t} { } - - Target & target; - - template - auto - toggle(Params &&... params) - { - return [params..., this](const SDL_Event &) { - toggleSetMode(std::forward(params)...); - }; - } - -private: - template - void - toggleSetMode(Params &&... params) - { - if (dynamic_cast(target.get())) { - if constexpr (msc == ModeSecondClick::Unset) { - target.reset(); - } - if constexpr (msc == ModeSecondClick::Reset) { - target = std::make_unique(std::forward(params)...); - } - } - else { - target = std::make_unique(std::forward(params)...); - } - } -}; -- cgit v1.2.3