Having a little trouble with my logic. I have commands, that are bsh scripts, that are available to all players based on security/access level.
I have a MudObject with a few required variables like id, name, desription and type. To make good use of the MudObject…I was thinkging:
-
To keep it as general as possible, I considered using a hashmap<String, MudVariable> to hold additional variables so each object could possibly have a different set without have to extend and create numerous classed for it.
-
Then do the same with methods. Have a hashmap<String, BSHScriptName> so each object could have various methods.
-
Add a few helper methods for add/remove and get. Make a single set of object methods so if 3 different objects have the TurnInvisible method, its one script and used by all (or potentially different ones, stored logically on a drive so TurnInvisible can function differently for a player and a dragon, and so on).
-
Or…each object has a sinle script with variables and methods unique to it?(seems things would get convoluted this way, not knowing what 46 different TurnInvisibles do on 46 different objects)…
Thoughts? ( I am using beanshell )
M
