func loadWildMin(ls *persist.LoadSaver) Frame { return WildMin{ OffType(ls.LoadByte()), ls.LoadInt(), patterns.Load(ls), } }
func loadFixed(ls *persist.LoadSaver) Frame { return Fixed{ OffType(ls.LoadByte()), ls.LoadInt(), patterns.Load(ls), } }
// Load a frame from a persist.LoadSaver func Load(ls *persist.LoadSaver) Frame { id := ls.LoadByte() l := loaders[int(id)] if l == nil { if ls.Err == nil { ls.Err = errors.New("bad frame loader") } return nil } return l(ls) }
// LoadIdentifier applies the appropriate IdentifierLoader to load an identifier. func LoadIdentifier(ls *persist.LoadSaver) Identifier { id := ls.LoadByte() l := loaders[int(id)] if l == nil { if ls.Err == nil { ls.Err = errors.New("bad identifier loader") } return nil } return l(ls) }
func loadKeyFrames(ls *persist.LoadSaver) [][]keyFrame { kfs := make([][]keyFrame, ls.LoadSmallInt()) for i := range kfs { kfs[i] = make([]keyFrame, ls.LoadSmallInt()) for j := range kfs[i] { kfs[i][j].typ = frames.OffType(ls.LoadByte()) kfs[i][j].seg.pMin = int64(ls.LoadInt()) kfs[i][j].seg.pMax = int64(ls.LoadInt()) kfs[i][j].seg.lMin = ls.LoadSmallInt() kfs[i][j].seg.lMax = ls.LoadSmallInt() kfs[i][j].key.pMin = int64(ls.LoadInt()) kfs[i][j].key.pMax = int64(ls.LoadInt()) kfs[i][j].key.lMin = ls.LoadSmallInt() kfs[i][j].key.lMax = ls.LoadSmallInt() } } return kfs }
func loadAnyMask(ls *persist.LoadSaver) patterns.Pattern { return AnyMask(ls.LoadByte()) }