]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/items/all.qh
Namespace registry functions
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / items / all.qh
index 1786b4261131d020fa92996027dee78c44c25a8d..4ef8bd4dad28be8bdea27466c1ee4c1f6233fc6a 100644 (file)
@@ -1,8 +1,14 @@
-#ifndef ALL_H
-#define ALL_H
+#include "../registry.qh"
 
+#ifndef ITEMS_ALL_H
+#define ITEMS_ALL_H
+
+void RegisterItems();
 const int MAX_ITEMS = 24;
 entity ITEMS[MAX_ITEMS];
+int ITEM_COUNT;
+/** If you register a new item, make sure to add it to all.inc */
+#define REGISTER_ITEM(id, class) REGISTER(RegisterItems, ITEM, ITEMS, ITEM_COUNT, id, class, m_id)
 
 #define ITEMS_FOREACH(pred, body) do {      \
     for (int i = 0; i < ITEM_COUNT; i++) {  \
@@ -11,7 +17,6 @@ entity ITEMS[MAX_ITEMS];
     }                                       \
 } while(0)
 
-void RegisterItems();
 void Dump_Items();
 
 #endif