Mario Kart 64
Loading...
Searching...
No Matches
Ship.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <libultraship.h>
4
#include <libultra/gbi.h>
5
#include "
CoreMath.h
"
6
#include "
RegisterContent.h
"
7
#include "
engine/Actor.h
"
8
9
class
AShip
:
public
AActor
{
10
public
:
11
12
enum
Skin
: int16_t {
13
GHOSTSHIP
,
14
SHIP2
,
15
SHIP3
,
16
};
17
18
explicit
AShip
(
const
SpawnParams
& params);
19
virtual
~AShip
() =
default
;
20
21
// This is simply a helper function to keep Spawning code clean
22
static
AShip
*
Spawn
(
FVector
pos,
IRotator
rot,
FVector
scale, int16_t skin) {
23
SpawnParams
params = {
24
.Name =
"hm:ship"
,
25
.Type = skin,
// which ship model to use
26
.Location = pos,
27
.Rotation = rot,
28
.Scale = scale,
29
};
30
return
dynamic_cast<
AShip
*
>
(
AddActorToWorld<AShip>
(params));
31
}
32
33
AShip::Skin
SpawnSkin
=
Skin::GHOSTSHIP
;
34
35
virtual
void
SetSpawnParams
(
SpawnParams
& params)
override
;
36
virtual
void
Tick
()
override
;
37
virtual
void
BeginPlay
()
override
;
38
virtual
bool
IsMod
()
override
;
39
virtual
void
DrawEditorProperties
()
override
;
40
private
:
41
Gfx*
_skin
;
42
};
Actor.h
CoreMath.h
RegisterContent.h
AddActorToWorld
static AActor * AddActorToWorld(const SpawnParams ¶ms)
Definition
RegisterContent.h:13
AActor::AActor
AActor()
Definition
Actor.cpp:13
AShip::Skin
Skin
Definition
Ship.h:12
AShip::GHOSTSHIP
@ GHOSTSHIP
Definition
Ship.h:13
AShip::SHIP2
@ SHIP2
Definition
Ship.h:14
AShip::SHIP3
@ SHIP3
Definition
Ship.h:15
AShip::Tick
virtual void Tick() override
Definition
Ship.cpp:63
AShip::SetSpawnParams
virtual void SetSpawnParams(SpawnParams ¶ms) override
Definition
Ship.cpp:44
AShip::_skin
Gfx * _skin
Definition
Ship.h:41
AShip::BeginPlay
virtual void BeginPlay() override
Definition
Ship.cpp:54
AShip::AShip
AShip(const SpawnParams ¶ms)
Definition
Ship.cpp:17
AShip::DrawEditorProperties
virtual void DrawEditorProperties() override
Definition
Ship.cpp:80
AShip::SpawnSkin
AShip::Skin SpawnSkin
Definition
Ship.h:33
AShip::~AShip
virtual ~AShip()=default
AShip::Spawn
static AShip * Spawn(FVector pos, IRotator rot, FVector scale, int16_t skin)
Definition
Ship.h:22
AShip::IsMod
virtual bool IsMod() override
Definition
Ship.cpp:78
FVector
Definition
CoreMath.h:30
IRotator
Definition
CoreMath.h:137
SpawnParams
Definition
SpawnParams.h:30
src
engine
actors
Ship.h
Generated by
1.13.2