A reimplementation of Mario Kart Wii's physics engine in C++
Loading...
Searching...
No Matches
ObjectSunManager.hh
1#pragma once
2
3#include "game/field/ObjectDirector.hh"
4#include "game/field/obj/ObjectSniper.hh"
5
6#include <string>
7
8namespace Kinoko::Field {
9
12class ObjectSunManager final : public ObjectSniper {
13public:
16 auto &managedObjs = ObjectDirector::Instance()->managedObjects();
17
18 size_t count = 0;
19
20 for (auto *&obj : managedObjs) {
21 if (strcmp(obj->getName(), "FireSnake") == 0) {
22 ++count;
23 }
24 }
25
26 m_projectiles = owning_span<ObjectProjectile *>(count);
27
28 size_t curIdx = 0;
29
30 for (auto *&obj : managedObjs) {
31 if (strcmp(obj->getName(), "FireSnake") == 0) {
32 m_projectiles[curIdx++] = reinterpret_cast<ObjectProjectile *>(obj);
33 } else if (strcmp(obj->getName(), "sunDS") == 0) {
34 m_launcher = reinterpret_cast<ObjectProjectileLauncher *>(obj);
35 }
36 }
37
38 u16 pointCount = m_launcher->railInterpolator()->pointCount();
39 m_pointIdxs = owning_span<s16>(pointCount);
40 }
41
43 ~ObjectSunManager() override = default;
44};
45
46} // namespace Kinoko::Field
Abstract class that moves along its own rail and throws projectiles.
Abstract class that represents an object thrown by an ObjectProjectileLauncher.
The base class for a manager object which is responsible for synchronizing a set of projectiles and a...
Handles the synchronization between the ObjectSunDS and ObjectFireSnake projectiles.
A contiguous storage container that manages the lifecycle of a buffer of a given size.
Definition Types.hh:29
Pertains to collision.