DnDCombatTracker icon indicating copy to clipboard operation
DnDCombatTracker copied to clipboard

Save/Import/Export characters

Open sander1095 opened this issue 9 years ago • 2 comments

Allow the user to save/import/export certain characters in a certain file format (JSON?) or SQLite database (with Entity Framework?) so it can be loaded after closing and opening the program again, or when loading it onto a different computer. You could maybe carry a USB Stick with the file on it, or save it somewhere in the cloud and then download it and import the characters.

sander1095 avatar Dec 29 '16 18:12 sander1095

The way it is probably gonna happen:

  • Save a .json file to the Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData folder. (Create a folder in there called D&D Combat Tracker. The file will be called Characters.json
  • The file will contain a list of categories. A category is a name (of the category) and a list of characters. (This is handy because users will be able to create different categories for different campaigns or something)
  • Allow the user to access this file by implementing #16 . By clicking on a certain option he can open a GUI and add/edit/delete/add categories/characters to current list/import*/export* categories and characters. He should be able to add (items from) multiple (and different) categories to the current list at the same time.

*Not planned for the first version:

  • Allow the user to import a character from a different location (USB drive or something). It will overwrite OR let the user choose what file to use.
  • Exception handling (what if the software can't write to the disk, what if the file is deleted while doing things)

sander1095 avatar Mar 28 '17 18:03 sander1095

I'd like to take a stab at this.

I am thinking about a PartyManagerService and a Party class.

public class Party { public Guid partyId { get; set; } public string Name { get; set; } public List<Character> Characters { get; set; } public string Notes { get; set; } }

the manager service will expose the following:

  • GetParties: returns a list of all currently saved parties
  • SaveParty: looks up to see if a party currently exists. If so, updates the party, otherwise saves a new party
  • SaveParties: (might be private) saves all parties to file.

herrozerro avatar Oct 09 '19 03:10 herrozerro