From 39ee30d617c06393670d997857a36df375e35b6b Mon Sep 17 00:00:00 2001 From: BlackMATov Date: Sun, 19 Jan 2020 05:05:59 +0700 Subject: [PATCH] dummy editor system --- headers/enduro2d/high/_all.hpp | 1 + headers/enduro2d/high/_high.hpp | 1 + .../enduro2d/high/systems/editor_system.hpp | 26 ++++++++++++ sources/enduro2d/high/starter.cpp | 3 ++ .../enduro2d/high/systems/editor_system.cpp | 41 +++++++++++++++++++ 5 files changed, 72 insertions(+) create mode 100644 headers/enduro2d/high/systems/editor_system.hpp create mode 100644 sources/enduro2d/high/systems/editor_system.cpp diff --git a/headers/enduro2d/high/_all.hpp b/headers/enduro2d/high/_all.hpp index a747d7f3..02cc881e 100644 --- a/headers/enduro2d/high/_all.hpp +++ b/headers/enduro2d/high/_all.hpp @@ -46,6 +46,7 @@ #include "components/sprite_renderer.hpp" #include "components/touchable.hpp" +#include "systems/editor_system.hpp" #include "systems/flipbook_system.hpp" #include "systems/input_system.hpp" #include "systems/label_system.hpp" diff --git a/headers/enduro2d/high/_high.hpp b/headers/enduro2d/high/_high.hpp index a1c3c926..7b64827f 100644 --- a/headers/enduro2d/high/_high.hpp +++ b/headers/enduro2d/high/_high.hpp @@ -66,6 +66,7 @@ namespace e2d class sprite_renderer; class touchable; + class editor_system; class flipbook_system; class input_system; class label_system; diff --git a/headers/enduro2d/high/systems/editor_system.hpp b/headers/enduro2d/high/systems/editor_system.hpp new file mode 100644 index 00000000..8e42b853 --- /dev/null +++ b/headers/enduro2d/high/systems/editor_system.hpp @@ -0,0 +1,26 @@ +/******************************************************************************* + * This file is part of the "Enduro2D" + * For conditions of distribution and use, see copyright notice in LICENSE.md + * Copyright (C) 2018-2019, by Matvey Cherevko (blackmatov@gmail.com) + ******************************************************************************/ + +#pragma once + +#include "_systems.hpp" + +namespace e2d +{ + class editor_system final + : public ecs::system> { + public: + editor_system(); + ~editor_system() noexcept final; + + void process( + ecs::registry& owner, + const ecs::after& trigger) override; + private: + class internal_state; + std::unique_ptr state_; + }; +} diff --git a/sources/enduro2d/high/starter.cpp b/sources/enduro2d/high/starter.cpp index 165da95d..9a9cd0a2 100644 --- a/sources/enduro2d/high/starter.cpp +++ b/sources/enduro2d/high/starter.cpp @@ -32,6 +32,7 @@ #include #include +#include #include #include #include @@ -58,6 +59,8 @@ namespace bool initialize() final { ecs::registry_filler(the().registry()) + .feature(ecs::feature() + .add_system()) .feature(ecs::feature() .add_system()) .feature(ecs::feature() diff --git a/sources/enduro2d/high/systems/editor_system.cpp b/sources/enduro2d/high/systems/editor_system.cpp new file mode 100644 index 00000000..cacc23a0 --- /dev/null +++ b/sources/enduro2d/high/systems/editor_system.cpp @@ -0,0 +1,41 @@ +/******************************************************************************* + * This file is part of the "Enduro2D" + * For conditions of distribution and use, see copyright notice in LICENSE.md + * Copyright (C) 2018-2019, by Matvey Cherevko (blackmatov@gmail.com) + ******************************************************************************/ + +#include + +namespace e2d +{ + // + // editor_system::internal_state + // + + class editor_system::internal_state final : private noncopyable { + public: + internal_state() = default; + ~internal_state() noexcept = default; + + void process(ecs::registry& owner) { + E2D_UNUSED(owner); + } + }; + + // + // editor_system + // + + editor_system::editor_system() + : state_(new internal_state()) {} + editor_system::~editor_system() noexcept = default; + + void editor_system::process( + ecs::registry& owner, + const ecs::after& trigger) + { + E2D_UNUSED(trigger); + E2D_PROFILER_SCOPE("editor_system.process"); + state_->process(owner); + } +}