]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Explain `CLASS` and `NEW` macros
authorTimePath <andrew.hardaker1995@gmail.com>
Wed, 6 May 2015 08:38:18 +0000 (08:38 +0000)
committerTimePath <andrew.hardaker1995@gmail.com>
Wed, 6 May 2015 08:38:18 +0000 (08:38 +0000)
qcsrc/menu/oo/base.qh

index db1dfcf6ac663166fb0fa1ec261f1c4d19295c78..5c74f0d6dffaca4a914b2ea2aedeceb5d7d4ef6b 100644 (file)
@@ -29,6 +29,10 @@ entity spawnObject(entity this, entity)
        return this;
 }
 
+// Classes have a `spawn##cname(entity, entity)` constructor
+// The parameters are used as locals for [[accumulate]]
+
+// Macro to hide this implementation detail
 #define NEW(cname) (spawn##cname(null_entity, null_entity))
 
 #define CLASS(cname, base)                                          \
@@ -64,4 +68,4 @@ entity cname##_vtbl;                                                \
 
 #define SUPER(cname) (cname##_vtbl.vtblbase)
 
-#endif
+#endif
\ No newline at end of file