INFO
	inheritance - the ineritance mechanism

DESCRIPTION
	An object can inherit all variables and functions from another object.
	This is done with the declaration 'inherit "file";'. This must come
	before any local variables or functions.

EXAMPLE
	Defining a monster:

	inherit "std/simple_monster";

	reset(arg) {
	  ::reset(arg);
	  set_name("troll");
	  set_level(9);
	  set_hp(100);
	  set_wc(12);
	  set_al(-60);
	  set_short("A troll");
	  set_long("It is a nasty troll that looks very aggressive.\n");
	  set_aggressive(1);
	}

	As always, refer to the inherited file to see the functions and
	variables available.

NOTE
	Some objects have declared their variables as private, in which case
	they cannot be directly accessed from inheriting objects, but the
	indirect mechanism of function calls must be used.

SEE ALSO
	/doc/efun/inherit

Help topics available:
C_vs_LPC Lesson1 README arrays block
class3 class4 class1 class2 control_structures
for foreach function inheritance keywords
learn_lpc/ lfuns lpc_standardized mappings operators
preprocessor profezzorn_has_the_word switch things_not_to_do types
virtual while

[START|BACK ]




[ NannyMuds main page | FAQ | Contact us ]

You are guest number 127 since November 2019.
This file was last modified: June 2000.