summaryrefslogtreecommitdiff
path: root/src/KingSystem/Chemical/chmSystemConfig.h
blob: 053fae0789a8654bbf0ac1dcb11313dcd0782f95 (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#pragma once

#include <basis/seadTypes.h>
#include <container/seadBuffer.h>
#include <heap/seadDisposer.h>
#include <hostio/seadHostIONode.h>
#include <utility/aglParameter.h>
#include <utility/aglParameterIO.h>
#include <utility/aglParameterList.h>
#include <utility/aglParameterObj.h>

namespace ksys::chm {

class SystemConfig : public agl::utl::IParameterIO, public sead::hostio::Node {
    SEAD_SINGLETON_DISPOSER(SystemConfig)
    SystemConfig() : agl::utl::IParameterIO("chmres", 0) {}
    ~SystemConfig() override;

public:
    struct Element : agl::utl::IParameterObj, sead::hostio::Node {
        Element();
        ~Element() override;

        agl::utl::Parameter<sead::FixedSafeString<64>> name;
        agl::utl::Parameter<sead::FixedSafeString<256>> label;
        agl::utl::Parameter<int> effect_type;
        agl::utl::Parameter<u32> attribute;
        agl::utl::Parameter<float> life_frames;
        agl::utl::Parameter<float> temperature;
        agl::utl::Parameter<int> type;
        agl::utl::Parameter<float> wetting_rate;
        agl::utl::Parameter<float> wind_speed;
        agl::utl::Parameter<float> electric_charge;
        agl::utl::Parameter<float> shock_wave_speed;
        agl::utl::Parameter<int> fire_level;
        agl::utl::Parameter<float> moisture;
    };

    struct Material : agl::utl::IParameterObj, sead::hostio::Node {
        Material();
        ~Material() override;

        agl::utl::Parameter<sead::FixedSafeString<64>> id;
        agl::utl::Parameter<sead::FixedSafeString<256>> label;
        agl::utl::Parameter<u32> attribute;
        agl::utl::Parameter<float> heat_capacity;
        agl::utl::Parameter<float> thermal_conductivity;
        agl::utl::Parameter<float> electrical_resistivity;
        agl::utl::Parameter<float> electrical_capacitance;
        agl::utl::Parameter<float> electromotive_force;
        agl::utl::Parameter<int> fire_proof_level;
        agl::utl::Parameter<float> ignition_point;
        agl::utl::Parameter<float> burn_speed;
        agl::utl::Parameter<float> wetting_amount;
        agl::utl::Parameter<float> wind_force_remain_rate;
        agl::utl::Parameter<sead::FixedSafeString<64>> burn_res_element_name;
        agl::utl::Parameter<sead::FixedSafeString<64>> warm_res_element_name;
        agl::utl::Parameter<sead::FixedSafeString<64>> exp_res_element_name;
        agl::utl::Parameter<sead::FixedSafeString<64>> exp_res_element_name1;
        agl::utl::Parameter<sead::FixedSafeString<64>> electricity_res_element_name;
        agl::utl::Parameter<sead::FixedSafeString<64>> ice_magic_res_element_name;
        agl::utl::Parameter<sead::FixedSafeString<64>> water_res_element_name;
    };

    struct World : agl::utl::IParameterObj, sead::hostio::Node {
        World();
        ~World() override;

        agl::utl::Parameter<sead::FixedSafeString<64>> id;
        agl::utl::Parameter<sead::FixedSafeString<256>> label;
        agl::utl::Parameter<float> evaporation_speed_rate;
        agl::utl::Parameter<float> heat_transfer_speed_rate;
        agl::utl::Parameter<float> fire_heat_transfer_speed_rate;
        agl::utl::Parameter<float> conduction_speed_rate_log;
        agl::utl::Parameter<float> burn_speed_rate;
        agl::utl::Parameter<float> fire_extra_radius;
        agl::utl::Parameter<float> player_fire_margin;
        agl::utl::Parameter<float> electricity_extra_radius_rate;
        agl::utl::Parameter<float> electric_water_extra_radius_rate;
        agl::utl::Parameter<float> min_ice_size;
        agl::utl::Parameter<float> ice_heat_cheat_threshold;
        agl::utl::Parameter<float> ice_heat_cheat_rate;
        agl::utl::Parameter<float> ice_melt_ratio_env_temp;
        agl::utl::Parameter<float> ice_melt_ratio_warm_air;
        agl::utl::Parameter<float> ice_melt_ratio_fire;
        agl::utl::Parameter<float> ice_melt_ratio_fire2;
        agl::utl::Parameter<float> wind_lift_rate;
        agl::utl::Parameter<float> lightning_distance;
        agl::utl::Parameter<float> character_ignition_count;
        agl::utl::Parameter<float> object_ignition_count;
        agl::utl::Parameter<float> offensive_rigid_radius;
    };

    struct List : agl::utl::IParameterList, sead::hostio::Node {
        ~List() override { ; }
    };

    void init(sead::Heap* heap);

    const World& getWorld(const sead::SafeString& name) const;
    const Material& getMaterial(const sead::SafeString& name) const;
    const Element& getElement(const sead::SafeString& name) const;

private:
    sead::Buffer<Material> mMaterials;
    sead::Buffer<Element> mElements;
    sead::Buffer<World> mWorlds;
    Material mDummyMaterial;
    Element mDummyElement;
    World mDummyWorld;
    List mWorldList;
    List mMaterialList;
    List mElementList;
};

}  // namespace ksys::chm