Almost one week into actually coding Java I'm steamrolling my project on my spare time, learning valuable lessons as I go. What I got thus far are classes for storing global values (abstract), reading data from file (with all the functionality in place to ensure easy customization or moddability of the finished application by the end user), user i/o interface (only a method for printing to command prompt thus far), debugging, and for testing the code. I also implemented a way to dynamically assign values for enumerated types of various sorts parsed from file (using my data reader class) and display this data in descriptive text strings.
My next step is probably to separate all the classes and whatnot into separate source files and collecting everything into a package. I also think I need to implement some exception handling, so I'll have to read up on both these subjects. Once I have a dedicated file for the enumerations I'll continue adding more stuff (like geographical locations, astrological signs and character archetypes) to what is already there (like the character attributes, months of the year and major landmasses in the game world setting). All instance attribute data is parsed from text files on execution, mind you.
Only then can I get on with mapping individual geographical enums to landmass enums - probably these need to be accessible (hashable?) in both directions for the application's purposes. Any ideas on how to implement something like this?
Eventually I'll get to the actual application that takes some number of user choices as input and creates something similar to a character horoscope - and also a legal set of character attributes. Everything is fully customizable from the ground up, by the way, like you could use another set of character attributes completely (even another number of attributes). So the application could be used in a completely different game setting - and also accommodate some house-ruling of the game mechanics.
By the way, is there any way to define the actual enum names (like WIND) by parsing them from a text-file. Like I'm currently using real world enum names for monts (like JANUARY) while the corresponding in-game name is Persil. Sure, I could just hard-code the enum name to PERSIL, but the whole point here is that it could be something else completely in another game setting. No big issue really, as the user will never see any of the enum names, but only as an exercise. It would also make my code much prettier (and shorter!) if I could also move all enum names to the data files.
So instead of doing this in my source file:
public enum Month{
JANUARY (DataReader.readNewDataLine(1, 1)),
FEBRUARY (DataReader.readNewDataLine(1, 1)),
MARCH (DataReader.readNewDataLine(1, 1)),
APRIL (DataReader.readNewDataLine(1, 1)),
MAY (DataReader.readNewDataLine(1, 1)),
JUNY (DataReader.readNewDataLine(1, 1)),
JULY (DataReader.readNewDataLine(1, 1)),
AUGUST (DataReader.readNewDataLine(1, 1)),
SEPTEMBER (DataReader.readNewDataLine(1, 1)),
OKTOBER (DataReader.readNewDataLine(1, 1)),
NOVEMBER (DataReader.readNewDataLine(1, 1)),
DECEMBER (DataReader.readNewDataLine(1, 1)),
}
...I could shorten it to a looping block by putting the enum names in my data file. Like this:
PERSIL:Persil
GYRSAG:Gyrsag
FATESKA:Fateska
ISKAMSI:Iskamsi
MISISKA:Misiska
MINDE:Minde
MELENDO:Melendo
BYRDO:Byrdo
GIREN:Giren
TARAGAN:Taragan
NUSIN:Nusin
TANNAN:Tannan
As the above example illustrates, the enum names themselves would be changed to reflect whatever game world setting is associated with the game at hand, instead of using the real-world names as identifiers.