add dummy script_system

This commit is contained in:
2019-10-22 03:20:20 +07:00
parent 5de8190e37
commit 6701dc2ec4
5 changed files with 89 additions and 0 deletions

View File

@@ -44,6 +44,7 @@
#include "systems/flipbook_system.hpp"
#include "systems/label_system.hpp"
#include "systems/render_system.hpp"
#include "systems/script_system.hpp"
#include "systems/spine_system.hpp"
#include "address.hpp"

View File

@@ -59,6 +59,7 @@ namespace e2d
class flipbook_system;
class label_system;
class render_system;
class script_system;
class spine_system;
template < typename Asset, typename Content >

View File

@@ -0,0 +1,32 @@
/*******************************************************************************
* 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 script_system final
: public ecs::system<
systems::update_event,
ecs::after<systems::frame_finalize_event>> {
public:
script_system();
~script_system() noexcept;
void process(
ecs::registry& owner,
const systems::update_event& event) override;
void process(
ecs::registry& owner,
const ecs::after<systems::frame_finalize_event>& event) override;
private:
class internal_state;
std::unique_ptr<internal_state> state_;
};
}

View File

@@ -27,6 +27,7 @@
#include <enduro2d/high/systems/flipbook_system.hpp>
#include <enduro2d/high/systems/label_system.hpp>
#include <enduro2d/high/systems/render_system.hpp>
#include <enduro2d/high/systems/script_system.hpp>
#include <enduro2d/high/systems/spine_system.hpp>
namespace
@@ -53,6 +54,8 @@ namespace
.add_system<label_system>())
.feature<struct render_feature>(ecs::feature()
.add_system<render_system>())
.feature<struct sript_feature>(ecs::feature()
.add_system<script_system>())
.feature<struct spine_feature>(ecs::feature()
.add_system<spine_system>());
return !application_ || application_->initialize();

View File

@@ -0,0 +1,52 @@
/*******************************************************************************
* 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/script_system.hpp>
namespace e2d
{
//
// script_system::internal_state
//
class script_system::internal_state final : private noncopyable {
public:
internal_state() = default;
~internal_state() noexcept = default;
void update_process(ecs::registry& owner) {
E2D_UNUSED(owner);
}
void finalize_process(ecs::registry& owner) {
E2D_UNUSED(owner);
}
};
//
// script_system
//
script_system::script_system()
: state_(new internal_state()) {}
script_system::~script_system() noexcept = default;
void script_system::process(
ecs::registry& owner,
const systems::update_event& event)
{
E2D_UNUSED(event);
state_->update_process(owner);
}
void script_system::process(
ecs::registry& owner,
const ecs::after<systems::frame_finalize_event>& event)
{
E2D_UNUSED(event);
state_->finalize_process(owner);
}
}