Creating a sports simulation
Posted on 1998-10-07
I am beginning to create a sports(hockey) simulation in C++ using Win95/MSVC++ 4.0 It will be text/statistical related only with no graphics. I would like to move it to MFC after the main "engine" is completed.
I would like to know an efficient way to hold the roster of players in memory and how they would be linked. My first idea was this:
//list of attributes such as name, jersey number,
//array of player abilities,(attributes)...etc
//Here I might put pointers of type Team and Player so
// that it might point the player to his team and to other
//players for the purpose of sorting.
I have decided to make it very object oriented so that players and teams could be created and destroyed easly. All the linking will be done by me without the help of things such as STL(unless you think that would work better).
I have tried to come up with a way to link players to box scores, team and to each other in a way that will make it easy to sort, and create leaderboards. Also, I would like an easy way to store them to a dat file using as little space as possible (maybe using bitfields)
If you need more information, I will be happy to provide it