public override void Restore(Stream str) { base.Restore(str); if (str.ReadByte() == 0) { IsUnpacked = str.ReadBool(); SecondaryEntryType = (PaletteEntryType)str.ReadShort(); int numberOfItems = str.ReadInteger(); if (numberOfItems > 0) { for (int i = 0; i < numberOfItems; i++) { BlockState state = (BlockState)str.ReadShort(); SlotStyleData ssd = new SlotStyleData(); ssd.Restore(str); Data.Add(state, ssd); } } } }
public void Unpack(FieldList source) { if (source == null) { return; } PairedList <ByteField, FieldList> searchResults = source.GetPairedItems <ByteField, FieldList>(DefAgentFieldID.ComponentState, DefAgentFieldID.DataPerComponentState); foreach (Pair <ByteField, FieldList> result in searchResults) { BlockState state = (BlockState)result.First.Data; if (!Data.ContainsKey(state)) { SlotStyleData newData = new SlotStyleData(); newData.Unpack(result.Second); Data[state] = newData; } } // done IsUnpacked = true; }
public void Restore(Stream str) { if (str.ReadByte() == 0) { SlotStyle = new SlotStyleData(); SlotStyle.Restore(str); SlotIndex = str.ReadInteger(); MarginLeft = str.ReadInteger(); MarginTop = str.ReadInteger(); MarginRight = str.ReadInteger(); MarginBottom = str.ReadInteger(); PaddingLeft = str.ReadInteger(); PaddingTop = str.ReadInteger(); PaddingRight = str.ReadInteger(); PaddingBottom = str.ReadInteger(); MaximumChars = str.ReadShort(); MaximumLines = str.ReadShort(); MinimumLines = str.ReadShort(); } }