Kinoko
A reimplementation of Mario Kart Wii's physics engine in C++
Toggle main menu visibility
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
8
namespace
Kinoko::Field
{
9
12
class
ObjectSunManager final :
public
ObjectSniper {
13
public
:
15
ObjectSunManager() {
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
Kinoko::Field::ObjectProjectileLauncher
Abstract class that moves along its own rail and throws projectiles.
Definition
ObjectProjectileLauncher.hh:8
Kinoko::Field::ObjectProjectile
Abstract class that represents an object thrown by an ObjectProjectileLauncher.
Definition
ObjectProjectile.hh:8
Kinoko::owning_span
A contiguous storage container that manages the lifecycle of a buffer of a given size.
Definition
Types.hh:31
Kinoko::Field
Pertains to collision.
Definition
BoxColManager.cc:10
game
field
obj
ObjectSunManager.hh
Made by
Malleo
. Logo by
vabold
. Website generated by
Doxygen
1.17.0