add dummy behaviour component

This commit is contained in:
2019-06-13 03:47:49 +07:00
parent 328bfe38ef
commit ec4e8cfa50
5 changed files with 70 additions and 0 deletions

View File

@@ -25,6 +25,7 @@
#include "assets/xml_asset.hpp"
#include "components/actor.hpp"
#include "components/behaviour.hpp"
#include "components/camera.hpp"
#include "components/flipbook_player.hpp"
#include "components/flipbook_source.hpp"

View File

@@ -37,6 +37,7 @@ namespace e2d
class xml_asset;
class actor;
class behaviour;
class camera;
class flipbook_player;
class flipbook_source;

View File

@@ -0,0 +1,33 @@
/*******************************************************************************
* 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 "../_high.hpp"
#include "../factory.hpp"
namespace e2d
{
class behaviour final {
public:
behaviour() = default;
};
template <>
class factory_loader<behaviour> final : factory_loader<> {
public:
static const char* schema_source;
bool operator()(
behaviour& component,
const fill_context& ctx) const;
bool operator()(
asset_dependencies& dependencies,
const collect_context& ctx) const;
};
}

View File

@@ -0,0 +1,33 @@
/*******************************************************************************
* 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/components/behaviour.hpp>
namespace e2d
{
const char* factory_loader<behaviour>::schema_source = R"json({
"type" : "object",
"required" : [],
"additionalProperties" : false,
"properties" : {}
})json";
bool factory_loader<behaviour>::operator()(
behaviour& component,
const fill_context& ctx) const
{
E2D_UNUSED(component, ctx);
return true;
}
bool factory_loader<behaviour>::operator()(
asset_dependencies& dependencies,
const collect_context& ctx) const
{
E2D_UNUSED(dependencies, ctx);
return true;
}
}

View File

@@ -11,6 +11,7 @@
#include <enduro2d/high/library.hpp>
#include <enduro2d/high/components/actor.hpp>
#include <enduro2d/high/components/behaviour.hpp>
#include <enduro2d/high/components/camera.hpp>
#include <enduro2d/high/components/flipbook_player.hpp>
#include <enduro2d/high/components/flipbook_source.hpp>
@@ -127,6 +128,7 @@ namespace e2d
safe_module_initialize<engine>(argc, argv, params.engine_params());
safe_module_initialize<factory>()
.register_component<actor>("actor")
.register_component<behaviour>("behaviour")
.register_component<camera>("camera")
.register_component<flipbook_player>("flipbook_player")
.register_component<flipbook_source>("flipbook_source")