summaryrefslogtreecommitdiff
path: root/src/KingSystem/Map/mapAutoPlacementFlowMgr.h
blob: df3b6648be247f51e88ec07b7d71bebad5ca03dd (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
#pragma once

#include <container/seadSafeArray.h>
#include <evfl/Flowchart.h>
#include <heap/seadDisposer.h>
#include <prim/seadSafeString.h>
#include "KingSystem/Resource/resHandle.h"

namespace ksys::map {

class AutoPlacement;

struct AutoPlacementFlowRes {
    void start(AutoPlacement* placement, const sead::SafeString& unit_name, int*);

    res::Handle handle;
    sead::SafeString evfl_name;
    evfl::FlowchartContext flowchart_ctx;
    AutoPlacement* placement;
    sead::SafeString unit_name;
    u8 idx;
    s8 placement_type;
};

class AutoPlacementFlowMgr {
    SEAD_SINGLETON_DISPOSER(AutoPlacementFlowMgr)
public:
    AutoPlacementFlowMgr();
    virtual ~AutoPlacementFlowMgr();

    void loadEventFlows();

    AutoPlacementFlowRes* getFlow(const sead::SafeString& actor_name, bool near_flow);

private:
    sead::Heap* mHeap;
    sead::SafeArray<AutoPlacementFlowRes, 10> mFlowArray;
    sead::SafeArray<AutoPlacementFlowRes, 7> mFlowNearArray;
};

}  // namespace ksys::map