diff --git a/CHANGELIST.md b/CHANGELIST.md index 47c08a30..26917fcd 100644 --- a/CHANGELIST.md +++ b/CHANGELIST.md @@ -28,6 +28,7 @@ - Disable special SmartE handling for DIC - Remove path from PS1/PS2 serial - Make TOC file optional for CD/GD +- Add datafile models ### 2.5 (2023-03-12) diff --git a/MPF.Modules/Datafile.cs b/MPF.Modules/Datafile.cs new file mode 100644 index 00000000..aaf9fca0 --- /dev/null +++ b/MPF.Modules/Datafile.cs @@ -0,0 +1,73 @@ +using System.Xml.Serialization; + +namespace MPF.Modules +{ + [XmlRoot("datafile")] + public class Datafile + { + [XmlElement("name")] + public Header Header; + + [XmlElement("game")] + public Game[] Games; + } + + public class Header + { + [XmlElement("name")] + public string Name; + + [XmlElement("description")] + public string Description; + + [XmlElement("version")] + public string Version; + + [XmlElement("date")] + public string Date; + + [XmlElement("author")] + public string Author; + + [XmlElement("homepage")] + public string Homepage; + + [XmlElement("url")] + public string Url; + } + + public class Game + { + [XmlAttribute("name")] + public string Name; + + [XmlElement("category")] + public string Category; + + [XmlElement("description")] + public string Description; + + [XmlElement("rom")] + public Rom[] Roms; + } + + public class Rom + { + [XmlAttribute("name")] + public string Name; + + [XmlAttribute("size")] + public string Size; + + [XmlAttribute("crc")] + public string Crc; + + [XmlAttribute("md5")] + public string Md5; + + [XmlAttribute("sha1")] + public string Sha1; + + // TODO: Add extended hashes here + } +}