// Load a character from a sitef record. func (me *Character) LoadSirec(rec sitef.Record) (err error) { aname := rec.Get("accountname") account, err := DefaultWorld.LoadAccount(aname) if err != nil { return err } me.Account = account me.Being.LoadSitef(rec) return nil }
// Load an entity from a sitef record. func (me *Entity) LoadSitef(rec sitef.Record) (err error) { me.ID = rec.Get("id") me.Name = rec.Get("name") me.Short = rec.Get("short") me.Long = rec.Get("long") return nil }
// Load a being from a sitef record. func (me *Being) LoadSitef(rec sitef.Record) (err error) { me.Entity.LoadSitef(rec) me.Level = rec.GetIntDefault("level", 1) me.Gender = EntitylikeToGender(GenderEntityList.FindID(rec.Get("gender"))) me.Job = EntitylikeToJob(JobEntityList.FindID(rec.Get("job"))) me.Kin = EntitylikeToKin(KinEntityList.FindID(rec.Get("kin"))) me.Talents.LoadSitef(rec) me.Vitals.LoadSitef(rec) me.EquipmentValues.LoadSitef(rec) me.Aptitudes.LoadSitef(rec) me.Inventory.LoadSitef(rec) if rec.Get("room") != "" { var err error me.Room, err = DefaultWorld.LoadRoom(rec.Get("room")) if err != nil { monolog.WriteError(err) return err } } return nil }