Re: Modulizing "Added Spells, Skills, Commands, etc"

From: Daniel A. Koepke (dkoepke@california.com)
Date: 08/18/00


On Fri, 18 Aug 2000, Treker wrote:

> Perhaps in future releases of CircleMUD, it'd be a good idea to make a
> header/source file pair called userdefined, which would contain all of
> the "added" spells and skills, thus centralizing any of the
> seek-and-replace work to one (or two) files, making it many times
> easier to add new spells, skills, commands, and probably reducing the
> code size (after adding the spells) as compared to the current method
> which forces the coder to run through more code than is required
> normally.

Spells and skills are defined in spells.h.  You do not need to change any
header files to add a command, just interpreter.c to add it to the command
table (you should also, of course, add the actual command somewhere; where
is arbitrary, but you might choose to follow the convention of wizard
commands in act.wiz.c, object manipulation commands in act.item.c, etc.).
Most other structures and defines are located in structs.h, with the
exception of parameterized macros (located in utils.h).  The layout is
pretty simple and already minimizes the amount of work you need to do to
just making a few small changes in a few well-defined places.

> I understand that Circle works fine without classes, but I can see
> many places where classes would reduce the code size and complexity.
> I guess I'm babbling, so I'll stop.

CircleMUD doesn't use classes because CircleMUD is written in C, not C++.
It has nothing to do with how well CircleMUD works without them, and
everything to do with the fact that they're just not available.  Having
said that, were we to rewrite CircleMUD from scratch, today, it would most
likely be in C++.

-dak


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 04/11/01 PDT