forked from cataclysmbnteam/Cataclysm-BN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
skill_boost.h
41 lines (31 loc) · 1008 Bytes
/
skill_boost.h
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
#ifndef CATA_SRC_SKILL_BOOST_H
#define CATA_SRC_SKILL_BOOST_H
#include <optional>
#include <string>
#include <vector>
#include "string_id.h"
class JsonObject;
template<typename T>
class generic_factory;
class skill_boost
{
public:
skill_boost() = default;
std::string stat() const;
const std::vector<std::string> &skills() const;
float calc_bonus( int skill_total ) const;
static void load_boost( const JsonObject &jo, const std::string &src );
static void reset();
static const std::vector<skill_boost> &get_all();
static std::optional<skill_boost> get( const std::string &stat_str );
private:
friend class generic_factory<skill_boost>;
string_id<skill_boost> id;
bool was_loaded = false;
std::vector<std::string> _skills;
int _offset = 0;
float _power = 0.0f;
void load( const JsonObject &jo, const std::string &src );
};
#endif // CATA_SRC_SKILL_BOOST_H