20sep09 CmdrZin
21 sep09

With the message format set up (see doc), this doc looks into how the lists are managed and how the update message is generated.

Since a character creation system is not inplace yet, all characters will start with a default set of stats, skills, and inventory.
These will be loaded into the lists when the player logs in the first time using the same method in MudMain.loggedIn() as the welcome text decision logic.

As a staert, everyone will be an Investigator level 1 and have generic stats, skills, and inventory. This will fill in the GUI boxes if nothing else.

NOTE: Should use HashMap instead of HashSet collections since access is by unique ID.
            Also use EnumSets to list all items to be stored in the list. (See ch 13 of Core Java I)

After reviewing the books, it looks like HashMap set is the way to go. So the only changes are on the Server side for now.

The four lists will now be Set<ListPair.ID, Integer> sets with other methods providing a link between the ID an what it represents. This will work like a relational data base.
For now, an array will be used to store static ID to String names to generate the info message back to the Client for display. Four ID to Name arrays will be in ListPair, which no longer should have to be Serializable.
All of the accessors and mutator methods are changed to use the ID of the object.

New Class: DataBase

This will be a static class used to retieve Strings for ListPair IDs. I don't want this class to be part of anything stored in the managed data base of the server or with any of the Managed Objects.
It will have a static array for each list and methods to access those arrays.


Adding ID

Change buildAndSendInfoMessage() to access the lists now and build up the info message string by callin the static DataBase class to get names.

Almost works..helps to initailize the DataBase..DOH..and init the Player's basic set..WOO HOO
Up and running..try other combo to be sure, then lock away..