Hi Rich,
Sorry haven't had a spare minute to look at what you've done here - I coordinate all the activites for our church service on Sunday so Saturday afternoon till after church on Sunday is really busy for me. I should be able to get back to this tomorrow. I hope to load it up and take a look!
Hey don't be sorry, I understand busy.
What I gave you will take care of 100% of your data needs but it's about 70% of your game needs.
I only implemented the Load/Save of the data and the Add/Delete of Categories and Words, all from the top object I called
TCWSContainer.
I didn't do any of the game logic, cuz I was only aiming at giving you an example of how to do the data manipulation with TObj
ects that then get marshalled to a JSON file.
The Container object has the
LoadFromFile() and
SaveToFile() that will take care of marshalling and un-marshalling of the data.
The Container also has
AddCategory() and
DeleteCategory() which only adds unique categories.
The Container also has
AddWord() and
DeleteWord() which only adds unique words under each category.
It also has
GetCategories() which will get you a
TStringList of all the categories and
GetWords(CategoryID) that will do the same for words.
I think it was MarkMLI that suggested that each word should have a
TDateTime for last played. I need to implement this in a manner that the getter/setter takes a
TDateTime, but drops an
Integer(UnixTime) on the object, so that when it's marshalled it's dropped as an
Integer. I guess I could try it with the double that
TDateTime is based on, but I dunno, I'll have a gander on that.
Cheers,
Gus