1
This commit is contained in:
parent
2282591789
commit
07ab6ec2aa
11
metatable.go
11
metatable.go
@ -149,6 +149,17 @@ func (this *NameMetaTable[T]) Load() {
|
|||||||
this.RawMetaTable.Load()
|
this.RawMetaTable.Load()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func ReadMetaTableField[T string | int | int32 | int64 | float32 | float64](
|
||||||
|
fieldPtr *T, fieldName string, flags *uint64, flagIdx int,
|
||||||
|
kv map[string]interface{}) {
|
||||||
|
if val, ok := kv[fieldName]; ok {
|
||||||
|
if !q5.DuckToSimple(val, fieldPtr) {
|
||||||
|
panic("ReadMetaTableField error")
|
||||||
|
}
|
||||||
|
//*flags = *flags & flagIdx
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func LoadMetaTable(table interface{}) {
|
func LoadMetaTable(table interface{}) {
|
||||||
ele := reflect.ValueOf(table).Elem()
|
ele := reflect.ValueOf(table).Elem()
|
||||||
for i := 0; i < ele.NumField(); i++ {
|
for i := 0; i < ele.NumField(); i++ {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user