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