Re: Some input needed

From: Daniel Koepke (dkoepke@CALIFORNIA.COM)
Date: 08/23/97


On Fri, 22 Aug 1997, Brian Gray wrote:

-+I would argue that the interpreter is specifically a player thing.  A mob
-+or object or anything else needs no interpreter.  It is inside the code
-+and can call whatever it wants with no mistakes.  Personally, I would put
-+it either in your player class or better yet, in your descriptor class.
-+After all, it is in a way a kind of input processing.

I think more apt would be to move the do_xxx() functions into the character
class (eg., player and mobiles), and the actual interpreter into either
the character or descriptor class.  This way you do:

  // stupid little example
  void character_class::example(char *str)
  {
     do_say(str,0,0);
  }

where do_say is part of the "character_class".  This way, mobiles like
Puff and things still have access to the do_xxx() functions, and you
eliminate some overhead by keeping the command interpreter away from
the mobile/general character class (I suppose player_class::interpreter).
Sound good? :)


--
Daniel Koepke -:- dkoepke@california.com -:-  [Shadowlord/Nether]
Think.


     +------------------------------------------------------------+
     | 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