1
This commit is contained in:
parent
35f839e5d4
commit
5fe4ba1d1f
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user