Documentation ¶
Index ¶
- Variables
- type BasicPlugin
- type FastPlugin
- type FuncNewPlugin
- type IPlugin
- type PluginBase
- func (bp *PluginBase) AddRngUsed(ri *sgc7utils.RngInfo)
- func (bp *PluginBase) ClearCache()
- func (bp *PluginBase) ClearUsedRngs()
- func (bp *PluginBase) GetScenePool() any
- func (bp *PluginBase) GetUsedRngs() []*sgc7utils.RngInfo
- func (bp *PluginBase) RollbackUsedRngs() error
- func (bp *PluginBase) SetCache(arr []int)
- func (bp *PluginBase) SetScenePool(pool any)
- func (bp *PluginBase) TagUsedRngs()
- type PluginsMgr
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidTag - invalid tag ErrInvalidTag = errors.New("invalid tag") )
View Source
var IsNoRNGCache bool
Functions ¶
This section is empty.
Types ¶
type FastPlugin ¶ added in v0.12.17
type FastPlugin struct { PluginBase RNG *fastrand.RNG }
BasicPlugin - basic plugin
func NewFastPlugin ¶ added in v0.12.17
func NewFastPlugin() *FastPlugin
NewFastPlugin - new a BasicPlugin
type IPlugin ¶
type IPlugin interface { // Random - return [0, r) Random(ctx context.Context, r int) (int, error) // GetUsedRngs - get used rngs GetUsedRngs() []*sgc7utils.RngInfo // ClearUsedRngs - clear used rngs ClearUsedRngs() // TagUsedRngs - new a tag for current UsedRngs TagUsedRngs() // RollbackUsedRngs - rollback UsedRngs with the latest tag RollbackUsedRngs() error // SetCache - set cache SetCache(arr []int) // ClearCache - clear cached rngs ClearCache() // Init - initial Init() // SetScenePool - set scene pool SetScenePool(any) // GetScenePool - get scene pool GetScenePool() any }
IPlugin - plugin
type PluginBase ¶ added in v0.12.23
PluginBase - base
func NewPluginBase ¶ added in v0.12.23
func NewPluginBase() PluginBase
func (*PluginBase) AddRngUsed ¶ added in v0.12.23
func (bp *PluginBase) AddRngUsed(ri *sgc7utils.RngInfo)
AddRngUsed - added used rngs
func (*PluginBase) ClearCache ¶ added in v0.12.23
func (bp *PluginBase) ClearCache()
ClearCache - clear cached rngs
func (*PluginBase) ClearUsedRngs ¶ added in v0.12.23
func (bp *PluginBase) ClearUsedRngs()
ClearUsedRngs - clear used rngs
func (*PluginBase) GetScenePool ¶ added in v0.12.23
func (bp *PluginBase) GetScenePool() any
GetScenePool - get scene pool
func (*PluginBase) GetUsedRngs ¶ added in v0.12.23
func (bp *PluginBase) GetUsedRngs() []*sgc7utils.RngInfo
GetUsedRngs - get used rngs
func (*PluginBase) RollbackUsedRngs ¶ added in v0.12.23
func (bp *PluginBase) RollbackUsedRngs() error
RollbackUsedRngs - rollback UsedRngs with a tag
func (*PluginBase) SetCache ¶ added in v0.12.23
func (bp *PluginBase) SetCache(arr []int)
SetCache - set cache
func (*PluginBase) SetScenePool ¶ added in v0.12.23
func (bp *PluginBase) SetScenePool(pool any)
SetScenePool - set scene pool
func (*PluginBase) TagUsedRngs ¶ added in v0.12.23
func (bp *PluginBase) TagUsedRngs()
TagUsedRngs - new a tag for current UsedRngs
type PluginsMgr ¶
type PluginsMgr struct {
// contains filtered or unexported fields
}
PluginsMgr - plugins manager
func NewPluginsMgr ¶
func NewPluginsMgr(funcNewPlugin FuncNewPlugin) *PluginsMgr
NewPluginsMgr - new a PluginsMgr
func (*PluginsMgr) FreePlugin ¶
func (mgr *PluginsMgr) FreePlugin(plugin IPlugin)
FreePlugin - free a Plugin
Click to show internal directories.
Click to hide internal directories.