| 12345678910111213141516171819202122232425262728293031323334353637 |
- //
- // bullet_pattern.hpp
- // danmaku
- //
- // Created by Sam Jaffe on 5/26/19.
- // Copyright © 2019 Sam Jaffe. All rights reserved.
- //
- #pragma once
- #include <json/forwards.h>
- #include <memory>
- namespace objects { namespace prototype {
- template <typename, typename...> class factory;
- }}
- namespace danmaku {
- class actor;
- struct bullet_timer {
- float const interval;
- float remaining{0.f};
- };
- struct bullet_pattern {
- virtual ~bullet_pattern() = default;
- virtual void update(float delta) = 0;
- };
- using bullet_pattern_factory =
- objects::prototype::factory<std::shared_ptr<bullet_pattern>, actor *,
- Json::Value const &>;
- }
- #define BIND_BULLET_PATTERN(name, function) \
- bool const _ = bullet_pattern_factory::instance().bind(name, function)\
|