``` feat(pet): 重构宠物繁殖系统,添加蛋孵化功能
This commit is contained in:
39
common/utils/timer/option.go
Normal file
39
common/utils/timer/option.go
Normal file
@@ -0,0 +1,39 @@
|
||||
// Copyright 2020-2024 guonaihong, antlabs. All rights reserved.
|
||||
//
|
||||
// mit license
|
||||
package timer
|
||||
|
||||
type option struct {
|
||||
timeWheel bool
|
||||
minHeap bool
|
||||
skiplist bool
|
||||
rbtree bool
|
||||
}
|
||||
|
||||
type Option func(c *option)
|
||||
|
||||
func WithTimeWheel() Option {
|
||||
return func(o *option) {
|
||||
o.timeWheel = true
|
||||
}
|
||||
}
|
||||
|
||||
func WithMinHeap() Option {
|
||||
return func(o *option) {
|
||||
o.minHeap = true
|
||||
}
|
||||
}
|
||||
|
||||
// TODO
|
||||
func WithSkipList() Option {
|
||||
return func(o *option) {
|
||||
o.skiplist = true
|
||||
}
|
||||
}
|
||||
|
||||
// TODO
|
||||
func WithRbtree() Option {
|
||||
return func(o *option) {
|
||||
o.rbtree = true
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user