Example #1
0
File: item.go Project: beoran/woe
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
}
Example #2
0
File: entity.go Project: beoran/woe
// 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
}
Example #3
0
File: being.go Project: beoran/woe
// 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
}
Example #4
0
// 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
}