func (me *Equipment) SaveSitef(rec sitef.Record) (err error) { for k, v := range me.Equipped { if v != nil { key := fmt.Sprintf("equipment[%s]", k) rec.Put(key, v.ID) } } return nil }
// Save an entity to a sitef record. func (me *Entity) SaveSitef(rec *sitef.Record) (err error) { rec.Put("id", me.ID) rec.Put("name", me.Name) rec.Put("short", me.Short) rec.Put("long", me.Long) return nil }
// 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 }
// Save a character into a a sitef record. func (me *Character) SaveSirec(rec *sitef.Record) (err error) { rec.Put("accountname", me.Account.Name) me.Being.SaveSitef(rec) return nil }