]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/items/all.qh
Merge branch 'master' into terencehill/menu_listbox_changes
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / items / all.qh
1 #include "../registry.qh"
2
3 #ifndef ALL_H
4 #define ALL_H
5
6 void RegisterItems();
7 const int MAX_ITEMS = 24;
8 entity ITEMS[MAX_ITEMS];
9 int ITEM_COUNT;
10 /** If you register a new item, make sure to add it to all.inc */
11 #define REGISTER_ITEM(id, class) REGISTER(RegisterItems, ITEM, ITEMS, ITEM_COUNT, id, class)
12
13 #define ITEMS_FOREACH(pred, body) do {      \
14     for (int i = 0; i < ITEM_COUNT; i++) {  \
15         const noref entity it = ITEMS[i];   \
16         if (pred) { body }                  \
17     }                                       \
18 } while(0)
19
20 void Dump_Items();
21
22 #endif
23
24 #include "inventory.qh"