summaryrefslogtreecommitdiff
path: root/src/engine/actors/Starship.h
blob: ed813fa534f4f8420452205274ffbfc5465e5a11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#pragma once

#include <libultraship.h>
#include <libultra/gbi.h>
#include "engine/CoreMath.h"
#include "engine/registry/RegisterContent.h"
#include "engine/Actor.h"
#include "engine/World.h"

extern "C" {
#include "common_structs.h"
#include "assets/textures/other_textures.h"
}

class AStarship : public AActor {
public:
    explicit AStarship(const SpawnParams& params);
    virtual ~AStarship() = default;

    // This is simply a helper function to keep Spawning code clean
    static AStarship* Spawn(FVector pos, IRotator rot, FVector scale, f32 speed, f32 radius) {
        SpawnParams params = {
            .Name = "hm:starship",
            .Location = pos,
            .Rotation = rot,
            .Scale = scale,
            .Speed = speed,
            .SpeedB = radius,
        };
        return dynamic_cast<AStarship*>(AddActorToWorld<AStarship>(params));
    }

    float SpeedB;

    virtual void SetSpawnParams(SpawnParams& params) override;
    virtual void Tick() override;
    virtual bool IsMod() override;
    virtual void BeginPlay() override;
    virtual void DrawEditorProperties() override;
};