blob: 65f45f8414d540a6c6c7ee4debed9ceca1d80dc3 (
plain) (
blame)
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
|
#pragma once
#include <string_view>
#include "openvic-simulation/misc/Modifier.hpp"
#include "openvic-simulation/dataloader/NodeTools.hpp"
#include "openvic-simulation/types/IdentifierRegistry.hpp"
namespace OpenVic {
struct LeaderTraitManager;
struct LeaderTrait : Modifier {
friend struct LeaderTraitManager;
enum class trait_type_t { PERSONALITY, BACKGROUND };
private:
const trait_type_t PROPERTY(trait_type);
/*
* Allowed modifiers for leaders:
* attack - integer
* defence - integer
* morale - %
* organisation - %
* reconnaissance - %
* speed - %
* attrition - %, negative is good
* experience - %
* reliability - decimal, mil gain or loss for associated POPs
*/
LeaderTrait(std::string_view new_identifier, trait_type_t new_type, ModifierValue&& new_modifiers);
public:
LeaderTrait(LeaderTrait&&) = default;
bool is_personality_trait() const;
bool is_background_trait() const;
};
struct LeaderTraitManager {
private:
IdentifierRegistry<LeaderTrait> IDENTIFIER_REGISTRY(leader_trait);
public:
bool add_leader_trait(std::string_view identifier, LeaderTrait::trait_type_t type, ModifierValue&& modifiers);
bool load_leader_traits_file(ModifierManager const& modifier_manager, ast::NodeCPtr root);
};
} // namespace OpenVic
|