// Save a being to a sitef record. func (me *Being) SaveSitef(rec *sitef.Record) (err error) { me.Entity.SaveSitef(rec) rec.PutInt("level", me.Level) if me.Gender != nil { rec.Put("gender", me.Gender.ID) } if me.Job != nil { rec.Put("job", me.Job.ID) } if me.Kin != nil { rec.Put("kin", me.Kin.ID) } me.Talents.SaveSitef(rec) me.Vitals.SaveSitef(rec) me.EquipmentValues.SaveSitef(rec) me.Aptitudes.SaveSitef(rec) me.Inventory.SaveSitef(rec) if me.Room != nil { rec.Put("room", me.Room.ID) } return nil }
func (me *Aptitudes) SaveSitef(rec *sitef.Record) (err error) { nskills := len(me.Skills) rec.PutInt("skills", nskills) for i := 0; i < nskills; i++ { rec.PutArrayIndex("skills", i, me.Skills[i].skill.ID) } return nil }