Re: Oasis suggestion

From: Patrick J. Dughi (dughi@IMAXX.NET)
Date: 03/13/98


>
> > Well, I opened up olc.h and looked at the defines, such as NUM_ROOMFLAGS,
> > etc. Now this doesn't make a lot of sense for them to be here. Why not
> > have them be in structs.h instead (since it appears BEFORE olc.h in the
> > defines at the top of the files). This way you can avoid questions about
> > adding in new flags and them not showing up on the Oasis Menu. What I mean
> > is like below the room flag defines, have this:
>
> I think even this is unneccessary.  Since the flag text in constants.c
> uses a linefeed to end the list, why not use that to determine how many
> flags you have?  Incrementing NUM_ROOMFLAGS doesn't do any good if you
> forget to add the new flag(s) to constants.c anyway.
>

        Have to agree with you there. Though it shouldn't be a problem one
has to deal with, it would be nice to have the code more coder-friendly.
For example, in many sections of oasis within the case statements, if you
break or return causes a very different effect, and the incorrect one
eventually may lead you to the "reached default case in blahblah..".
Shortly thereafter, the mud crashes.  It's a stupid mistake, but since
some of the main parts of oasis are counter-intuitive, you really have to
know how to _not_ make it.  It would be nice to see Oasis more
modularized, and not based on some huge obscene mess of an event handler.

        Proposal:
                Instead of using the single large messy switching
statements, have sub modes. Example:

mediting a mob, at the MEDIT_MAIN_MENU for OLC_MODE(d). I want to change
the level. OLC_MODE(d) is changed to MEDIT_LEVEL or what ever.  Instead of
dealing with it in the large function, just have something like:
        case MEDIT_LEVEL:
                deal_with_medit_level();
                break;
       }
    OLC_MODE(d)=MEDIT_MAIN_MENU;

        Basically have the sub-functions deal with the exact function, and
leave it up to that.  If you have multiple cases, fine, have a submode..
OLC_MODE(d) = OEDIT_VALUES;
OLC_SUBMODE(d)=OEDIT_SUB_VALUE_ONE;
deal_with_oedit_values()

within..
switch (OLC_SUBMODE()) {
  case OEDIT_SUB_VALUE_ONE:
        /*do stuff here*/
   OLC_SUBMODE(d)=OEDIT_SUB_VALUE_TWO;
   break;
  case OEDIT_SUB_VALUE_TWO:
                .
                .
                .
}
return;

        You can still treat the handler the same way, with the main loop
doing the continual character grabbing, but it will be easier to integrate
new functions.

                                                PjD


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



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