Chip gets a promotion

This commit is contained in:
Matt Nadareski
2020-08-25 22:48:46 -07:00
parent 0fa843a587
commit 143668c56a
13 changed files with 457 additions and 218 deletions

View File

@@ -383,6 +383,22 @@ namespace SabreTools.Library.DatFiles
};
break;
case "chip":
datItem = new Chip
{
Name = reader.GetAttribute("name"),
Tag = reader.GetAttribute("tag"),
ChipType = reader.GetAttribute("chiptype"),
Clock = reader.GetAttribute("clock"),
Source = new Source
{
Index = indexId,
Name = filename,
},
};
break;
case "disk":
datItem = new Disk
{
@@ -855,6 +871,17 @@ namespace SabreTools.Library.DatFiles
xtw.WriteEndElement();
break;
case ItemType.Chip:
var chip = datItem as Chip;
xtw.WriteStartElement("file");
xtw.WriteAttributeString("type", "chip");
xtw.WriteRequiredAttributeString("name", chip.Name);
xtw.WriteOptionalAttributeString("tag", chip.Tag);
xtw.WriteOptionalAttributeString("chiptype", chip.ChipType);
xtw.WriteOptionalAttributeString("clock", chip.Clock);
xtw.WriteEndElement();
break;
case ItemType.Disk:
var disk = datItem as Disk;
xtw.WriteStartElement("file");