it's sorta like recursion, but jankier

master
Jordan Orelli 8 years ago
parent efdf9e3d54
commit c9a27c915b

@ -60,8 +60,10 @@ func ieeeFloat32Decoder(br bit.Reader) interface{} {
func entityDecoder(c *Class) decoder {
return func(br bit.Reader) interface{} {
// I have no idea what this bit means.
return bit.ReadBool(br)
if bit.ReadBool(br) {
return c.New(-1)
}
return nil
}
}

@ -39,7 +39,21 @@ func (s selection) fill(dest slotted, br bit.Reader) error {
Debug.Printf("%v -> %v", old, val)
return nil
default:
return fmt.Errorf("child selections aren't done yet")
Debug.Printf("fill child selection...")
inner := dest.getSlotValue(s.vals[0])
inner_s, ok := inner.(slotted)
if !ok {
return fmt.Errorf("child selection refers to a slot that doesn't contain a slotted value")
}
return s.next().fill(inner_s, br)
}
}
func (s selection) next() selection {
// rofl this is weird
return selection{
count: s.count - 1,
vals: [6]int{s.vals[1], s.vals[2], s.vals[3], s.vals[4], s.vals[5], 0},
}
}

Loading…
Cancel
Save