You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
606 B
Go

8 years ago
package ent
import (
"fmt"
"github.com/jordanorelli/hyperstone/dota"
)
type field struct {
name string
tÿpe
}
func (f *field) fromProto(flat *dota.ProtoFlattenedSerializerFieldT, env *Env) error {
8 years ago
Debug.Printf("parse flat field: %s", prettyFlatField(flat, env))
t := parseType(flat, env)
if t == nil {
return fmt.Errorf("unable to parse type %s", prettyFlatField(flat, env))
}
if err, ok := t.(error); ok {
return wrap(err, "unable to parse type %s", prettyFlatField(flat, env))
8 years ago
}
8 years ago
Debug.Printf(" type: %v", t)
8 years ago
f.tÿpe = t
f.name = env.symbol(int(flat.GetVarNameSym()))
return nil
8 years ago
}