You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
628 B
Go
24 lines
628 B
Go
package ent
|
|
|
|
type Entity struct {
|
|
*Class
|
|
serial int
|
|
slots []interface{}
|
|
isBaseline bool
|
|
}
|
|
|
|
func (e *Entity) slotName(n int) string { return e.Class.Fields[n].name.String() }
|
|
func (e *Entity) slotType(n int) string { return e.Class.Fields[n]._type.String() }
|
|
func (e *Entity) slotValue(n int) interface{} {
|
|
v := e.slots[n]
|
|
if v != nil {
|
|
return v
|
|
}
|
|
if !e.isBaseline && e.Class.baseline != nil {
|
|
return e.Class.baseline.slotValue(n)
|
|
}
|
|
return nil
|
|
}
|
|
func (e *Entity) slotDecoder(n int) decoder { return e.Class.Fields[n].decoder }
|
|
func (e *Entity) setSlotValue(n int, v interface{}) { e.slots[n] = v }
|