Re: [NEWBIE] Case Values

From: Shane Augustine (sca@bu.edu)
Date: 02/23/99


I think I know what you're talking about.  There's a couple of remort
snippets
around that can help you with this.  I think I saw one at ftp.circlemud.org.

I'm guessing to add extra fields to the player struct like chclass2 and
chclass3
but you'll have to make checks for both of these everytime you make a check
for
the 'original' class.  Then you can use nested case statements.  I.E.

switch(class) {
    case CLASS_WARRIOR:
    switch(class2) {
        case CLASS_MAGE:
        switch(class3) {
            case CLASS_CLERIC:
            return a; // Player is a warrior/mage/cleric combo
       }
   }
}
Of course this could get confusing.  You'd also have to be careful that the
order
doesn't matter.  I.e. warrior/cleric/thief or thief/warrior/cleric would
return same
value.  I hope that helps.


Kaine LaZaro wrote:

> I'm trying to change how everything in the switch statement works, I'd
> like to be able to use multi-character values ie war mag cle and thi etc
> (I have 34 classes I'll not go on.)
>
> James aka Kaine
>
> `Up, Down, Over, and Through, Back arround the Jokes on you!'
>  -- Magic the Gathering
>
>      +------------------------------------------------------------+
>      | Ensure that you have read the CircleMUD Mailing List FAQ:  |
>      |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
>      +------------------------------------------------------------+


     +------------------------------------------------------------+
     | 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 : 12/15/00 PST