Asking for recommendations about how to deal with data.
Here is what I am doing:
I have created baseball sim. Within that sim I am trying to create a way to store the unique players outcomes and the overall team outcomes, or more to the point - record the stats for both players and teams in a .dat file. I know how to do this however I dont know what is the best way.
I have also have dat files that store the players skills/roster, and those are team by team. So 9 players per team, each team has its own dat file, not one big dat file where all the players are stored.
Should I store the players stats on the same dat file as their skills/roster or create a separate dat file for the stats? I'm not sure what is best or recommended.
What are the requirements? Are the files ever used seperately? And, if so, should the other part not be available?
I always try to split the files in the manner of "one file, one responsibility". So, e.g., when I have a program and I want to save, say, the keyboard-settings, I don't want to save the graphics-settings at the same time (because I want to transfer the key-settings to another computer with another hardware configuration). But at the same time I try to minimize the total number of files, so oftentimes this means that say garphics- and audio settings go to the same file, since they both depend on the hardware configuration.
Thanks for the reply. That makes sense the "one file one responsibility." The files would always be used separately, the player skills ie is read only for the sim, and the stats are write only, in that the sim will not modify the skills only read them in then only write the stats.