本文整理匯總了Golang中github.com/beoran/woe/sitef.Record.Put方法的典型用法代碼示例。如果您正苦於以下問題:Golang Record.Put方法的具體用法?Golang Record.Put怎麽用?Golang Record.Put使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/beoran/woe/sitef.Record
的用法示例。
在下文中一共展示了Record.Put方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: SaveSitef
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
}
示例2: SaveSitef
// 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
}
示例3: SaveSitef
// 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
}
示例4: SaveSirec
// 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
}