public static ImageFile ReadImageFile(this CacheReader f) { var flags = (UxlImageFileFlags)f.ReadByte(); var srcName = f.ReadGlobalValue(); SourceValue?dstName = null , cond = null; if (flags.HasFlag(UxlImageFileFlags.HasCondition)) { cond = f.ReadGlobalValue(); } if (flags.HasFlag(UxlImageFileFlags.HasTargetName)) { dstName = f.ReadGlobalValue(); } int?w = null, h = null; if (flags.HasFlag(UxlImageFileFlags.HasTargetWidth)) { w = f.ReadCompressedInt(); } if (flags.HasFlag(UxlImageFileFlags.HasTargetHeight)) { h = f.ReadCompressedInt(); } return(new ImageFile(srcName, cond, dstName, w, h)); }