| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- //
- // actor.hpp
- // danmaku
- //
- // Created by Sam Jaffe on 5/26/19.
- // Copyright © 2019 Sam Jaffe. All rights reserved.
- //
- #pragma once
- #include "game/engine/entity.hpp"
- namespace objects { namespace prototype {
- template <typename, typename...> class factory;
- }}
- namespace graphics {
- class manager;
- }
- namespace danmaku {
- class level;
- struct actor : public engine::entity {
- using engine::entity::entity;
- virtual ~actor() = default;
- virtual void update(float delta) = 0;
- virtual void level(class level *) = 0;
- virtual class level * level() const = 0;
- };
- struct bullet_pattern;
- using attack_factory = std::function<std::shared_ptr<bullet_pattern>(
- Json::Value const &, actor *)>;
- using actor_factory =
- objects::prototype::factory<std::unique_ptr<actor>, Json::Value const &,
- graphics::object const &, attack_factory>;
- }
- #define BIND_ACTOR(name, function) \
- bool const _ = actor_factory::instance().bind(name, function)
|