[Code] [Clan Allocation]

From: Matthew Bergman (silk@direct.ca)
Date: 01/13/97


Ok right now I implemented clans into my mud, and this is how I did it, and
you will most likely find it isn't that efficient, but I am very new to
coding and this is how I allocated things:

Basically the clan.h file contained defines like:

-- snip --
#define CLAN_NONE       0
#define CLAN_EDGE       1
#define CLAN_DABUMS     2
-- snip --

#define RANK_NONE       0
#define RANK_INITIATE   1
#define RANK_NOVICE     2
#define RANK_COMMANDER  3
#define RANK_SENIOR     4
#define RANK_MASTER     5

-- snip --
then my clan.c file had:

const char *pc_clan_types[] = {
"",
"--EDGE--",
"--DaBums",
"\n"
};

const char *pc_rank_types[] = {
"",
"Initiate",
"Novice",
"Commander",
"Senior",
"Master",
"\n"
};

Then I have several clan based commands like : recruit, promote, demote, expell,
leaveclan which are basically straight checks with:

GET_CLAN(vict) = GET_CLAN(ch); 

etc, etc.

I also then did this (only way I knew and this is where I think it may be
taking up unnesscary memory) 
changed the spare0; 's etc to clan, and rank so they are stored in the
playerfile.

Now here is my beef, or question.  The way i call the clan names is I copied the
CLASS_NAME, CLASS_ABBR in utils.h and added a CLAN_NAME, and CLAN_RANK to
call it

Is there an easier way like to have a directory in the lib like
/etc/clan/1.clan etc?

Instead of storing in the playerfile could you simply set up a list of
members in a lib file and read it say 'backwards' ?

Remember I am new to C and mud coding so try to be in newbie english :)
Hasta Lasagna, Don't Get Any On ya!
silk@direct.ca


+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/18/00 PST