Re: [CODE] find_class_bitvector problem

From: Fabio de Oliveira Fagundes (fagundes@AQUARIUS.IME.EB.BR)
Date: 09/18/97


Hi folks,
        I'm a newbie coding Circle but what I can sugest is that u use number to choose the classes...
        Something like that:


long find_class_bitvector(char arg)
{
  arg = LOWER(arg);

  switch (arg) {
    case '0':
      return (1 << 0);
      break;
    case '1':
      return (1 << 1);
      break;
    case '2':
      return (1 << 2);
      break;
    case '3':
      return (1 << 3);
      break;
    default:
      return 0;
      break;
  }
}

Then when someone creates a char it should be:
Select a class:
  [1]Magic-user
  [2]Cleric
  [3]Thief
  [4]Warrior

Class:

Then u go on adding classes that will be checked in that case command by numbers:)



                        Hope that helps u,

                                        Fabio Fagundes
TerrorMUD forte.ime.eb.br 6666

> long find_class_bitvector(char arg)
> {
>   arg = LOWER(arg);
>
>   switch (arg) {
>     case 'm':
>       return (1 << 0);
>       break;
>     case 'c':
>       return (1 << 1);
>       break;
>     case 't':
>       return (1 << 2);
>       break;
>     case 'w':
>       return (1 << 3);
>       break;
>     default:
>       return 0;
>       break;
>   }
> }
>
> so I have a wizard class...simple enough.  add this after the case 'w' part:
>
> case 'w':
>   return (1 << 4);
>   break;
>
> but in case you didn't notice, there is already a case 'w' right there.  How
> can I put in the wizard class without having to rename the classes?  I
> looked for all instances of find_class_bitvector in the code but I can't
> seem to see what needs to be done so I can have wizard send an 'i' or
> something through there.  Anyone know what I missed?


     +------------------------------------------------------------+
     | 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/08/00 PST