dummy editor system

This commit is contained in:
2020-01-19 05:05:59 +07:00
parent 6a765cb782
commit 39ee30d617
5 changed files with 72 additions and 0 deletions

View File

@@ -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"

View File

@@ -66,6 +66,7 @@ namespace e2d
class sprite_renderer;
class touchable;
class editor_system;
class flipbook_system;
class input_system;
class label_system;

View File

@@ -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<ecs::after<systems::post_render_event>> {
public:
editor_system();
~editor_system() noexcept final;
void process(
ecs::registry& owner,
const ecs::after<systems::post_render_event>& trigger) override;
private:
class internal_state;
std::unique_ptr<internal_state> state_;
};
}

View File

@@ -32,6 +32,7 @@
#include <enduro2d/high/components/sprite_renderer.hpp>
#include <enduro2d/high/components/touchable.hpp>
#include <enduro2d/high/systems/editor_system.hpp>
#include <enduro2d/high/systems/flipbook_system.hpp>
#include <enduro2d/high/systems/input_system.hpp>
#include <enduro2d/high/systems/label_system.hpp>
@@ -58,6 +59,8 @@ namespace
bool initialize() final {
ecs::registry_filler(the<world>().registry())
.feature<struct editor_feature>(ecs::feature()
.add_system<editor_system>())
.feature<struct flipbook_feature>(ecs::feature()
.add_system<flipbook_system>())
.feature<struct input_feature>(ecs::feature()

View File

@@ -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 <enduro2d/high/systems/editor_system.hpp>
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<systems::post_render_event>& trigger)
{
E2D_UNUSED(trigger);
E2D_PROFILER_SCOPE("editor_system.process");
state_->process(owner);
}
}