Documentation Area

CHAPTER 1
Extended Room Features:
Until now we have only talked about the basic room features. All these
features are available in every room. With these functions you are able
to create quite good rooms. But the extended features show the real power
of the room2 support.
Annotation:
Kiri says in August 2016: I'm not so sure about the last sentence in the
above paragraph! ;-)
Real coders ;-) don't need/use/like EXTD_ROOM for following reasons:
- EXTD_ROOM changes from inheritance to including a lot of code,
- BUT inheritance is much faster,
- inheritance saves memory,
- if you want more than those "features" offer, real coders ;-) often get
stuck as you can't overwrite the original functions when using includes,
- then you have to do much more on your own,
- most "features" can be coded VERY easily,
- real coders can create all those "features" of EXTD_ROOM with much
more features! ;-)
- to be continued ...
If you want to use one of the following features you have to define it
by its name and define EXTD_ROOM, both before the include <room2.h>
line. But with this define you change the way the room support is
provided from inherit to include (see the second chapter).
Therefore there are some differences, because using include you are not
able to overwrite the functions init() and long(str), which are needed
for extra actions and extra descriptions.
You have to replace "long(str) { ::long(str);" by "extra_long(str) {"
and you have to
#define EXTRA_LONG extra_long(str);
before the
#include <room2.h>
line.
You have to replace "init() { ::init();" by "extra_init() {" and you
have to
#define EXTRA_INIT extra_init();
before the
#include <room2.h>
Annotation in August 2016:
See page 15 of this tutorial or https://nemesis.de/lpc/doc/room2/page15 :
Also without EXTD_ROOM "extra_init()" is correct (now)!
Changed/modified/modernised by Kiri in August 2016.
See also: