Re: [CODE] Some input please for idea

From: Jack Wilson (deejay@cu-online.com)
Date: 10/28/96


Ebon Mists wrote:
> 
> > Yep.  It's actually very easy to do this.  Just set up #define's for all
> > the "global" variables that are actually instance variables in the
> > different
> > worlds.  For example, try:
> >
> > struct World {
> >    struct room_data *world;
> >    int top_of_world;
> >    ...
> > };
> >
> > Then, in your main program, have a global variable called current_realm:
> >
> >    struct World *current_realm;
> >  ...
> Dear lord... why spend all the time and effort... do as I did:
> In the zone data add an:
> int realm;
> 
> And just set diffrent realsm to diffrent numbers, then add in some checks as
> to who can see and hear what. 1 thousand times easier than splitting up
> worlds and everything into diffrent structs.

The difference is that the World structure is very straightforward.  You
only need to do a search and replace, and as I just realized, you don't
even need to do that:

   #define world current_realm->my_world

so you don't even have to do any textual substitution.

Once you've added a global World structure and macro hooks into that
World (50 lines of code), everything magically "works" without you
having
to litter your code with special cases.  It's much more robust than
having to track down all the instances in your code where realms might
apply.

I really question your contention that your method is "1 thousand times
easier".  I suspect your code was easier to install, but took many weeks
to debug.  I feel kind of sorry for your players.

BTW, how's "Mud Tech" coming?  It's only 2 months overdue now... ;)

-- 
[----- Jack Wilson ------- mailto:deejay@cu-online.com ----------------]
[--- Home page: http://www.cu-online.com/~deejay/ ---------------------]
[- PGP fingerprint:  99 C9 B7 A3 C4 72 DD 87  72 CF 67 50 63 48 D0 6D -]
+-----------------------------------------------------------+
| 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