Design Details

All of these objects are abstract , unless otherwise noted.

Core Lib Hierarchy

  • GameObject - Everything in the game inherits from this base object.
    • Map - An object comprises of singleton rooms.
      • Planet - An object modeling a complete world.
      • Vessel - An object modeling a movable vessel.
    • Container - An object that can contain other objects.
      • Room - A singleton location.
      • Mobile - A movable object.
        • Living - A living object with hit points, etc..
          • Creature - A Mobile with arbitrary limbs.
            • Humanoid - A creature with two arms and two legs.
              • Player - A user in the game.
              • NPC - A non-player humanoid.
    • Immobile - An object that cannot move or contain other objects. (i.e. Rock, Statue, etc.)

Input Process

This section describes the high-level details of how a user inputs a command into the system.
We are assuming that a user has navigated to the game home page and has an empty command prompt, waiting for a command.
  1. User types in a command and clicks "Submit".
  2. Controller will make a call to the Engine.ParseCommand() method and pass in the user's entered text.
  3. Engine.ParseCommand() will:
    1. Split the command into a verb ( parameters[0] ) and arguments ( parameters[1..n] ))
    2. foreach(CommandParserBase cpb in Player's Parsers:
      1. Call cpb.ParseCommand()
      2. Stop when a true is encountered, indicating parsing should not proceed any further.
The default implementation of CommandParserBase.ParseCommand() will:
  1. Check for internal implementations of the verb, i.e. native game commands ( MortalParser class will have virtual methods that implement things like look, who, quit, etc. )
  2. Build a target list
    1. Every object in the player's inventory that responds to the system event PlayerVerb
    2. The container that the player resides
    3. All objects in the same container
  3. Call HandleEvent() with PlayerVerbEventArgs on each target in the list (stopping when a true occurs.

HandleEvent() in each responding object will:
  1. Parent of hierarchy trees in the CoreLib (like Room) will
    1. Be decorated with RespondsTo Attribute containing the text for Player Verb.
    2. Dispatch on verb argument to strongly-typed event handlers.

Last edited Sep 11, 2009 at 4:43 PM by dudeknt, version 3

Comments

No comments yet.