… | |
… | |
31 | |
31 | |
32 | /* TREASURE_VERBOSE enables copious output concerning artifact generation */ |
32 | /* TREASURE_VERBOSE enables copious output concerning artifact generation */ |
33 | |
33 | |
34 | //#define TREASURE_VERBOSE |
34 | //#define TREASURE_VERBOSE |
35 | |
35 | |
36 | #include <unordered_map> |
|
|
37 | |
|
|
38 | #include <global.h> |
36 | #include <global.h> |
39 | #include <treasure.h> |
37 | #include <treasure.h> |
40 | |
38 | |
|
|
39 | #include <flat_hash_map.hpp> |
|
|
40 | |
41 | extern char *spell_mapping[]; |
41 | extern char *spell_mapping[]; |
42 | |
42 | |
43 | static treasurelist *first_treasurelist; |
43 | static treasurelist *first_treasurelist; |
44 | |
44 | |
45 | static void change_treasure (treasure *t, object *op); /* overrule default values */ |
45 | static void change_treasure (treasure *t, object *op); /* overrule default values */ |
46 | |
46 | |
47 | typedef std::unordered_map< |
47 | typedef ska::flat_hash_map< |
48 | const char *, |
48 | const char *, |
49 | treasurelist *, |
49 | treasurelist *, |
50 | str_hash, |
50 | str_hash, |
51 | str_equal, |
51 | str_equal, |
52 | slice_allocator< std::pair<const char *const, treasurelist *> > |
52 | slice_allocator< std::pair<const char *const, treasurelist *> > |
53 | > tl_map_t; |
53 | > tl_map_t; |
54 | |
54 | |
55 | static tl_map_t tl_map; |
55 | static tl_map_t tl_map; |
56 | |
56 | |
57 | //TODO: class method |
57 | //TODO: class method |