Good day, I am making a game on C # Win Forms. It is necessary to make statistics on players and when starting the game, so that you can either add a new player or select from already created records. What you need. Create a new structure for each player and store in a file? Then how to make a player's choice (in the drop-down menu, for example) please help, in which direction to move, there are no ideas at all. Thanks.
|
1 answer
- Get a data structure describing a single player. Inside it, keep all the statistics related to the player. Remember to implement
INotifyPropertyChanged. - Get a list of such structures. For WinForms,
BindingListprobably better. - When the program finishes, serialize the list onto a disk (for example, via Settings, or manually). When restarting, deserialize from disk.
- You can display the list with the help of anything, for example, through a
ListBox.
- Thank you very much, and the choice of the player how to implement, do not tell me? - Maxim Ustelemov
- @ Maksim Ustelemov: If you use
ListBox, you can throughSelectedItem. - VladD
|