forked from CleverRaven/Cataclysm-DDA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
scent_block.h
45 lines (34 loc) · 1011 Bytes
/
scent_block.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
#pragma once
#ifndef CATA_SRC_SCENT_BLOCK_H
#define CATA_SRC_SCENT_BLOCK_H
#include <algorithm>
#include <array>
#include "coordinate_conversions.h"
#include "point.h"
#include "scent_map.h"
struct scent_block {
template<typename T>
using data_block = std::array < std::array < T, SEEY + 2 >, SEEX + 2 >;
enum class data_mode : int {
NONE = 0,
SET = 1,
MAX = 2
};
struct datum {
data_mode mode;
int intensity;
};
data_block<datum> assignment;
tripoint origin;
scent_map &scents;
int modification_count;
scent_block( const tripoint &sub, scent_map &scents );
void commit_modifications();
point index( const tripoint &p ) const {
return -origin.xy() + p.xy();
}
// We should be working entirely within the range, so don't range check here
void apply_gas( const tripoint &p, int nintensity = 0 );
void apply_slime( const tripoint &p, int intensity );
};
#endif // CATA_SRC_SCENT_BLOCK_H