# HG changeset patch # User IBBoard # Date 1298493877 0 # Node ID 5434e648379cb2a3292aefa8e07433212a7d7ed1 # Parent f7c3c1b39726bcfd010d0451210434dd9f8818ab Re #328: Add saving of Race and System data to files * Turn IWarFoundryFileSaver into a marker interface * Add missing Army and Race saver classes * Add stub implementations to IWarFoundryFileSaver diff -r f7c3c1b39726 -r 5434e648379c IBBoard.WarFoundry.API.csproj --- a/IBBoard.WarFoundry.API.csproj Sun Feb 20 20:36:48 2011 +0000 +++ b/IBBoard.WarFoundry.API.csproj Wed Feb 23 20:44:37 2011 +0000 @@ -1,5 +1,5 @@ - - + + Debug AnyCPU @@ -184,6 +184,8 @@ + + diff -r f7c3c1b39726 -r 5434e648379c api/Factories/Xml/WarFoundryXmlSaver.cs --- a/api/Factories/Xml/WarFoundryXmlSaver.cs Sun Feb 20 20:36:48 2011 +0000 +++ b/api/Factories/Xml/WarFoundryXmlSaver.cs Wed Feb 23 20:44:37 2011 +0000 @@ -182,5 +182,15 @@ containedUnitElem.SetAttribute("containedID", XmlTools.GetAsciiXmlIdForString(unit.ID)); return containedUnitElem; } + + public bool Save (Race race, string path) + { + throw new System.NotImplementedException (); + } + + public bool Save (GameSystem system, string path) + { + throw new System.NotImplementedException (); + } } } diff -r f7c3c1b39726 -r 5434e648379c api/Savers/IWarFoundryArmySaver.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/api/Savers/IWarFoundryArmySaver.cs Wed Feb 23 20:44:37 2011 +0000 @@ -0,0 +1,27 @@ +// This file (IWarFoundryArmySaver.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2011 IBBoard. +// +// The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license. + +using System; +using IBBoard.WarFoundry.API.Objects; + +namespace IBBoard.WarFoundry.API.Savers +{ + public interface IWarFoundryArmySaver + { + /// + /// Saves an to a file on disk. + /// + /// + /// The to save + /// + /// + /// The path to save the army to + /// + /// + /// TRUE if saving succedes, else FALSE + /// + bool Save(Army army, string path); + } +} + diff -r f7c3c1b39726 -r 5434e648379c api/Savers/IWarFoundryFileSaver.cs --- a/api/Savers/IWarFoundryFileSaver.cs Sun Feb 20 20:36:48 2011 +0000 +++ b/api/Savers/IWarFoundryFileSaver.cs Wed Feb 23 20:44:37 2011 +0000 @@ -7,20 +7,8 @@ namespace IBBoard.WarFoundry.API.Savers { - public interface IWarFoundryFileSaver + public interface IWarFoundryFileSaver : IWarFoundryGameSystemSaver, IWarFoundryRaceSaver, IWarFoundryArmySaver { - /// - /// Saves an to a file on disk. - /// - /// - /// The to save - /// - /// - /// The path to save the army to - /// - /// - /// TRUE if saving succedes, else FALSE - /// - bool Save(Army army, string path); + //Marker interface } } diff -r f7c3c1b39726 -r 5434e648379c api/Savers/IWarFoundryGameSystemSaver.cs --- a/api/Savers/IWarFoundryGameSystemSaver.cs Sun Feb 20 20:36:48 2011 +0000 +++ b/api/Savers/IWarFoundryGameSystemSaver.cs Wed Feb 23 20:44:37 2011 +0000 @@ -1,4 +1,4 @@ -// This file (IWarFoundrySystemSaver.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2008, 2009 IBBoard. +// This file (IWarFoundryGameSystemSaver.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2008, 2009, 2011 IBBoard. // // The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license. diff -r f7c3c1b39726 -r 5434e648379c api/Savers/IWarFoundryRaceSaver.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/api/Savers/IWarFoundryRaceSaver.cs Wed Feb 23 20:44:37 2011 +0000 @@ -0,0 +1,27 @@ +// This file (IWarFoundryRaceSaver.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2011 IBBoard. +// +// The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license. + +using System; +using IBBoard.WarFoundry.API.Objects; + +namespace IBBoard.WarFoundry.API +{ + public interface IWarFoundryRaceSaver + { + /// + /// Saves an to a file on disk. + /// + /// + /// The to save + /// + /// + /// The path to save the army to + /// + /// + /// TRUE if saving succedes, else FALSE + /// + bool Save(Race race, string path); + } +} +