Patrick's Lucky Dip - pdhData Package |
||
The ProblemI have been working rather intermittently on a game for a number of years. It's aiming to be a Civ-type game based on colonising Mars. One of the key issues was to be able to hold game data and reference data. I wanted to use text files so I could read them and edit them using a simple text editor. I used the file format of old *.ini files as used by Microsoft many years ago (my age is showing here). The SolutionI created a number of classes for managing the data which also act as the base classes for almost all the classes used in the game. I then grouped these into a single package. These are the classes: PdhData contains the methods needed to read and save the data to text files. One day I may even get around to building in support for storing data in xml format. PdhArray contains an ArrayList to manage collections of PdhData elements. PdhError contains some basic error values which can help with intelligent error handling. Patrick Haston |
||