This commit is contained in:
aozhiwei 2024-03-26 12:58:03 +08:00
parent 35f839e5d4
commit 5fe4ba1d1f

View File

@ -7,6 +7,7 @@ import (
"os"
"q5"
"reflect"
"math/rand"
)
type MetaTable interface {
@ -56,6 +57,13 @@ func (this *RawMetaTable[T]) PreInit1() {
func (this *RawMetaTable[T]) PostInit1() {
}
func (this *RawMetaTable[T]) RandElement() *T {
if len(this.rawList) > 0 {
return this.rawList[rand.Intn(len(this.rawList))]
}
return nil
}
func (this *RawMetaTable[T]) ElementsInit(round int) {
type RoundInit1 interface {
Init1()