示例#1
0
 public static DoorEvent Serdes(DoorEvent e, AssetMapping mapping, ISerializer s, TextId textSourceId)
 {
     if (s == null)
     {
         throw new ArgumentNullException(nameof(s));
     }
     e ??= new DoorEvent(textSourceId);
     e.PickDifficulty = s.UInt8(nameof(PickDifficulty), e.PickDifficulty);
     e.Key            = ItemId.SerdesU16(nameof(Key), e.Key, AssetType.Item, mapping, s);
     e.OpenedText     = s.UInt8(nameof(OpenedText), e.OpenedText);
     e.UnlockedText   = s.UInt8(nameof(UnlockedText), e.UnlockedText);
     e.DoorId         = DoorId.SerdesU16(nameof(DoorId), e.DoorId, mapping, s); // Usually 100+
     return(e);
 }