Opened 9 years ago

Last modified 9 years ago

#324 accepted enhancement

Add saving of Race and System data to files

Reported by: ibboard Owned by:
Priority: major Milestone: WarFoundry API 0.2
Component: WarFoundry-API Version: Trunk
Keywords: save data system race Cc:
Blocked By: #338 Blocking: #321, #321

Description

WarFoundry Forge needs to be able to save the data it creates into a file. This should be a zip file with XML ("native" format) and other formats for other apps should be ignored and put under an "export" heading.

The new methods should extend the existing saver interface/class and (if necessary) break up classes for readability as per the existing XML Loader classes.

More discussion in the forum.

Change History (22)

comment:1 Changed 9 years ago by ibboard

Status: newaccepted

Accept new tickets en-mass

comment:2 Changed 9 years ago by ibboard

Blocking:

comment:3 Changed 9 years ago by ibboard

Blocked By: 338 added

(In #338)

comment:4 Changed 9 years ago by ibboard

In [807]:

Re #324: Add saving of Race and System data to files

  • Convert IWarFoundryFileSaver from a marker interface into an interface with a purpose of its own so that we can support multiple data files in one zip
  • Repurpose WarFoundryXmlSaver to be just an Army saver - we still need to make it usable as part of a larger whole
  • Add a WarFoundryLoadedObject class for objects loaded from files and make Race/Army/GameSystem inherit from it

comment:5 Changed 9 years ago by ibboard

In [808]:

Re #324: Add saving of Race and System data to files

  • Swap to new method call for saving army
  • Temporarily cause NullRef exceptions by removing the setting of a saver

comment:6 Changed 9 years ago by ibboard

In [809]:

Re #324: Add saving of Race and System data to files

  • Move saver classes out of Factories folder and into Savers folder/namespace

comment:7 Changed 9 years ago by ibboard

In [810]:

Re #324: Add saving of Race and System data to files

  • Create initial skeleton of XML file saver

comment:8 Changed 9 years ago by ibboard

In [811]:

Re #324: Add saving of Race and System data to files

  • Add first unit test for file savers

comment:9 Changed 9 years ago by ibboard

In [812]:

Re #324: Add saving of Race and System data to files

  • Add test to make sure file is a zip (native format)

comment:10 Changed 9 years ago by ibboard

In [813]:

Re #324: Add saving of Race and System data to files

  • Tidy up after unit test

comment:11 Changed 9 years ago by ibboard

In [814]:

Re #324: Add saving of Race and System data to files

  • Create zip file

comment:12 Changed 9 years ago by ibboard

In [815]:

Re #324: Add saving of Race and System data to files

  • Add unit test for file count

comment:13 Changed 9 years ago by ibboard

In [816]:

Re #324: Add saving of Race and System data to files

  • Add entries to zip file

comment:14 Changed 9 years ago by ibboard

In [817]:

Re #324: Add saving of Race and System data to files

  • Add skeleton of method for file extensions when saving

comment:15 Changed 9 years ago by ibboard

In [818]:

Re #324: Add saving of Race and System data to files

  • Add tests for the zip entry name

comment:16 Changed 9 years ago by ibboard

In [820]:

Re #324: Add saving of Race and System data to files

  • Test file extensions for saved zip entries

comment:17 Changed 9 years ago by ibboard

In [821]:

Re #324: Add saving of Race and System data to files

  • Construct correct names for entries

comment:18 Changed 9 years ago by ibboard

In [825]:

Re #324: Add saving of Race and System data to files

  • Start to migrate Army saving to same structure
    • Add first test
    • Give MockArmy a specific ID

comment:19 Changed 9 years ago by ibboard

In [826]:

Re #324: Add saving of Race and System data to files

  • As per GameSystem changes for using existing code:
    • Make XML creation method public
    • Make sure we're encoding in UTF-8
    • Implement saving method for Army

comment:20 Changed 9 years ago by ibboard

In [827]:

Re #324: Add saving of Race and System data to files

  • Add unit tests for multiple files in one zip

comment:21 Changed 9 years ago by ibboard

In [829]:

Re #324: Add saving of Race and System data to files

  • Add tests for two systems in one file

comment:22 Changed 9 years ago by ibboard

In [830]:

Re #324: Add saving of Race and System data to files

  • Remove extra interfaces, as their replacements would be implementation specific and the break-down is now only a clean coding issue
  • Strip out extra code from Army and GameSystem saver
Note: See TracTickets for help on using tickets.