Creating Item Instances
I think that Karak's final example is pretty close to the basic usage that would be required.
For a single behavior a constructor would be available for
Item(IItemBehavior itemBehavior)
For multiple behaviors we might have
Item(IList itemBehaviors)
These would really only be used by code that builds the world. The rest of the time the following constructor would be used
Item(IItemRecord itemRecord)
Then the child behaviors would be automatically be loaded.
I need to add the ability to save in the database a non WheelMud Item Behavior by adding a column with the class name to use to construct the extended behavior. This is similar to the functionality that the Items currently have.
Getting Behaviors from Item Instances
To get a behavior record from the Item I was thinking of adding a generic method.
Something like
item.getBehavior < ILiquidBehavior >();
I figure that this will work for both internal behaviors and externally supplied behaviors since the external command that is using this new behavior will know about it and be able to ask for it. The internal commands will know about the internally supported behaviors.