From ca97fcf09ae82c8e67f7cc23eb4a6e7938517613 Mon Sep 17 00:00:00 2001 From: TimePath Date: Wed, 6 May 2015 08:38:18 +0000 Subject: [PATCH] Explain `CLASS` and `NEW` macros --- qcsrc/menu/oo/base.qh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qcsrc/menu/oo/base.qh b/qcsrc/menu/oo/base.qh index db1dfcf6a..5c74f0d6d 100644 --- a/qcsrc/menu/oo/base.qh +++ b/qcsrc/menu/oo/base.qh @@ -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 -- 2.39.2