public bool ReadPlaceables(Location location) { if (_root == null) { return(false); } XmlElement node = _root["Placeables"]; if (node == null) { return(false); } if (!node.GetBoolean("IsExists")) { return(true); } Placeables placeables = new Placeables(node.ChildNodes.Count); foreach (XmlElement child in node.ChildNodes) { ulong value = child.GetUInt64("Value"); placeables.Add(new Placeable(BitConverter.GetBytes(value))); } location.Placeables = placeables; location.SaveRequest &= ~LocationProperty.Placeables; location.Importable |= LocationProperty.Placeables; return(true); }
public bool ReadPlaceables(Location location) { ArchiveFileEntry pcbEntry = (ArchiveFileEntry)_locationDirectory.Childs.TryGetValue(_name + ".pcb"); if (pcbEntry == null) { return(true); } using (PcbFileReader pcbReader = new PcbFileReader(pcbEntry.OpenReadableContentStream())) { Placeables placeables = new Placeables(pcbReader.Entries.Length); for (int i = 0; i < placeables.Capacity; i++) { placeables.Add(new Placeable(pcbReader.Entries[i].Unknown)); } location.Placeables = placeables; } location.SaveRequest &= ~LocationProperty.Placeables; location.Importable &= ~LocationProperty.Placeables; return(true); }