forked from cataclysmbnteam/Cataclysm-BN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
map_item_stack.h
51 lines (41 loc) · 1.65 KB
/
map_item_stack.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
#pragma once
#ifndef CATA_SRC_MAP_ITEM_STACK_H
#define CATA_SRC_MAP_ITEM_STACK_H
#include <string>
#include <vector>
#include "point.h"
class item;
class map_item_stack
{
private:
class item_group
{
public:
tripoint pos;
int count;
//only expected to be used for things like lists and vectors
item_group();
item_group( const tripoint &p, int arg_count );
};
public:
// This should be per-group!
const item *example; //an example item for showing stats, etc.
tripoint example_item_pos;
std::vector<item_group> vIG;
int totalcount;
//only expected to be used for things like lists and vectors
map_item_stack();
map_item_stack( const item *it, const tripoint &pos );
// This adds to an existing item group if the last current
// item group is the same position and otherwise creates and
// adds to a new item group. Note that it does not search
// through all older item groups for a match.
void add_at_pos( const item *it, const tripoint &pos );
static bool map_item_stack_sort( const map_item_stack &lhs, const map_item_stack &rhs );
};
std::vector<map_item_stack> filter_item_stacks( const std::vector<map_item_stack> &stack,
const std::string &filter );
int list_filter_high_priority( std::vector<map_item_stack> &stack, const std::string &priorities );
int list_filter_low_priority( std::vector<map_item_stack> &stack, int start,
const std::string &priorities );
#endif // CATA_SRC_MAP_ITEM_STACK_H