Inheritance is a very powerful feature, that allows you to reuse code
that has been written earlier. For instance, all your rooms inherit
a lot of code that give them a big number of properties; exits, lights,
the capability to contain people and items etc.
Exactly how inheritance works is covered in other turorials, this file
explains how inheritance works when you are using CD gamedrivers with
version numbers 2.something.

There are 2 forms for inheritance, unnamed and named.

Unamed inheritance has the form

inherit "<filepath>";

Named inheritance has the form

inherit "<filepath>" name;

Examples:

inherit "/std/armour";
inherit "/lib/shop" stdshop;

IMPORTANT!
The inherit statements can appear after #defines in a file, but must
appear before any declarations or executable code.

SINGLE INHERITANCE
Single inheritance is the most common form of inheritance. You inherit
one file (the equvalent of a class in normal object oriented terminology),
and then you modify the behaviour in some way. An example of this is a
normal room. It inherits /std/room, and then it modifies things like
name, exits and pseudoitems. A room often redefines the create_room
and reset_rrom functions that are already present in /std/room. This is
called masking of the inherited functions. Sometimes you wish to add
extra functionality to a function that is already present in the inherited
object. An example of this is a room where you want to add an extra command.
You then write your own init() function, but in order to get the exit
commands of the room added, you also have to call the init() function in
/std/room. This can be done by making a call of the form

::init();

The :: tells the gamedriver to look in the inherited file for the function,
instead of the in the present file.

If you have used named inheritance, you have the option of writing

<name>::init();

where <name> is the name you used in the inheritance statement.
When you are using single inheritance, named inheritance is never
necessary, it becomes useful if you use multiple inheritance.

You can access variables in inherited files in the same way as you can
access functions. This is rather seldom used though, since you seldom
need to redefine variables.

Please note that you only need to use the :: syntax if you have redefined
the function or variable. In other cases the gamedriver will automatically
find the right function.

If you have an inheritance chain, ie a file that inherits a file, that inherits
a file (etc), you can use more than one :: operator to access functions
further back in the inheritance chain.

Examples:

::::init();
a::b::init();

This is very rarely needed.


MULTIPLE INHERITANCE

You have multiple inheritance when a file inherits functions and variables
from more than one file.

An example of this is a room, that is also a shop. The room file will
start with something like:

inherit "/std/room";
inherit "/lib/shop";

The room will then get all the properties of /std/room, and all the
properties of /lib/shop. If the inherited files define functions or
variables with the same name, the definition of the first inherit in 
the file is the one that gets used.

Named inheritance is used to resolve conflicts when you have multiple
definitions of functions or variables in the different inherited files.

When you build your inheritable files, you should always try to think ahead
about the way the file is going to be used, so that you avoid name conflicts.
Name conflicts make the code harder to read, understand and debug.

VIRTUAL BASE CLASSES
Virtual base classes is a fancy name for something that is rather simple
to understand, but quite some job to implement. To explain what it is and
why we use it, I'll make an example:

We want to make a main gauche, which is an object that is both an armour 
and a weapon.

We have the following objects with their inheritance chains:

/std/weapon = A
/std/armour = B
/std/object = C

	C		C
	|		|
	A		B

If we make our new object /d/Wiz/tintin/main_cauche (called D here) we
would without virtual inheritance get a structure like this:

	C   C
	|   |
	A   B
	\   /
	  D

This means that we get 2 copies of C, with a double set of all variables, and
a double set of all functions. If any function in C is declared nomask, we
can't do the inheritance at all, since it would mask itself.
Also, if we managed to make the inheritance, operations on variables in
C from A and D would take effect on the first instance of C, while the
operations in B would take effect on the second one. This is normally
very confusing and not at all what you want.

So, from version 2 of the CD gamedriver, we use a concept called virtual
base classes. It simply means, that no matter how many times we inherit
a file, we just get one copy of each variable in the file, and we just
get one instance of every function.

The structure in the example looks like this now:

	  C
	/   \
	A   B
	\   /
	  D
