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 db1dfcf..5c74f0d 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