From cae5165dbcd74592d07a9e9d0637f5f0db56a0d2 Mon Sep 17 00:00:00 2001 From: NoahLan <6995syu@163.com> Date: Tue, 19 Dec 2023 11:29:34 +0800 Subject: [PATCH] feat: katago options --- ngochess/katago/options.go | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 ngochess/katago/options.go diff --git a/ngochess/katago/options.go b/ngochess/katago/options.go new file mode 100644 index 0000000..dddff63 --- /dev/null +++ b/ngochess/katago/options.go @@ -0,0 +1,29 @@ +package katago + +import "time" + +func WithOptions(opt Options) Option { + return func(options *Options) { + options.DevMode = opt.DevMode + options.MaxMessageId = opt.MaxMessageId + options.Timeout = opt.Timeout + } +} + +func WithDevMode(val bool) Option { + return func(options *Options) { + options.DevMode = val + } +} + +func WithMaxMessageId(max uint64) Option { + return func(options *Options) { + options.MaxMessageId = max + } +} + +func WithTimeout(timeout time.Duration) Option { + return func(options *Options) { + options.Timeout = timeout + } +}