summaryrefslogtreecommitdiff
path: root/src/engine/objects/Hedgehog.h
blob: 4a377ef32c093016861e683f5a4691f8ff884af4 (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#pragma once

#include <libultraship.h>
#include <vector>
#include "Object.h"

#include "engine/registry/RegisterContent.h"
#include "engine/World.h"

extern "C" {
#include "macros.h"
#include "main.h"
#include "vehicles.h"
#include "waypoints.h"
#include "common_structs.h"
#include "objects.h"
#include "camera.h"
#include "some_data.h"
}

/**
 * @arg pos FVector xyz spawn position
 * @arg patrolPoint FVector2D xz patrol to location. Actor automatically calculates the Y value
 * @arg behaviour unknown, seems unused.
 */
class OHedgehog : public OObject {
public:
    explicit OHedgehog(const SpawnParams& params);

    // This is simply a helper function to keep Spawning code clean
    static inline OHedgehog* Spawn(const FVector& pos, const FVector2D& patrolPoint, s16 behaviour) {
        SpawnParams params = {
            .Name = "mk:hedgehog",
            .Behaviour = behaviour, // Appears to be unused
            .Location = pos,
            .PatrolEnd = patrolPoint,
        };
        return static_cast<OHedgehog*>(AddObjectToWorld<OHedgehog>(params));
    }

    ~OHedgehog() {
        _count--;
    }

    static size_t GetCount() {
        return _count;
    }

    virtual void Tick() override;
    virtual void Draw(s32 cameraId) override;
    virtual void SetSpawnParams(SpawnParams& params) override;
    virtual void DrawEditorProperties() override;

    void func_800555BC(s32 objectIndex, s32 cameraId);
    void func_8004A870(s32 cameraId, s32 objectIndex, f32 arg1);

    void func_8008311C(s32 objectIndex, s32 arg1);
    void func_80083248(s32 objectIndex);
    void func_800833D0(s32 objectIndex, s32 arg1);
    void func_80083474(s32 objectIndex);


private:
    FVector2D PatrolEnd;
    static size_t _count;
    size_t _idx;
};