31 lines
708 B
C++
31 lines
708 B
C++
// Copyright (c) 2023 Dominic Masters
|
|
//
|
|
// This software is released under the MIT License.
|
|
// https://opensource.org/licenses/MIT
|
|
|
|
#pragma once
|
|
#include "scene/Scene.hpp"
|
|
|
|
namespace Dawn {
|
|
class SimpleComponent final : public SceneComponent {
|
|
private:
|
|
std::vector<std::function<void()>> events;
|
|
|
|
public:
|
|
std::function<void(
|
|
SceneComponent&,
|
|
std::vector<std::function<void()>>&
|
|
)> initMethod;
|
|
|
|
void onInit() override;
|
|
void onDispose() override;
|
|
};
|
|
|
|
std::shared_ptr<SimpleComponent> addSimpleComponent(
|
|
std::shared_ptr<SceneItem> item,
|
|
std::function<void(
|
|
SceneComponent&,
|
|
std::vector<std::function<void()>>&
|
|
)> init
|
|
);
|
|
} |