forked from CleverRaven/Cataclysm-DDA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
shearing.h
53 lines (40 loc) · 1.06 KB
/
shearing.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
42
43
44
45
46
47
48
49
50
51
52
53
#pragma once
#include "damage.h"
#ifndef CATA_SRC_SHEARING_H
#define CATA_SRC_SHEARING_H
#include <vector>
#include "itype.h"
class monster;
struct shearing_roll {
itype_id result;
int amount = 0;
};
struct shearing_entry {
itype_id result;
int amount = 0;
int random_min = 0;
int random_max = 0;
float ratio_mass = 0.0f;
float ratio_volume = 0.0f;
shearing_roll roll( const monster &mon ) const;
bool was_loaded = false;
void load( const JsonObject &jo );
//void deserialize( JsonIn &jsin );
};
class shearing_data
{
public:
shearing_data() = default;
explicit shearing_data( std::vector<shearing_entry> &shearing_entries );
bool valid() const {
return valid_;
}
const std::vector<shearing_entry> &entries() const {
return entries_;
}
std::vector<shearing_roll> roll_all( const monster &mon ) const;
private:
bool valid_ = false;
std::vector<shearing_entry> entries_;
};
#endif // CATA_SRC_SHEARING_H