From ca90ebdfa8789654766c5d7969baa7afacd9ebd2 Mon Sep 17 00:00:00 2001 From: BanceDev Date: Mon, 16 Feb 2026 16:31:54 -0500 Subject: initial commit --- client/quake/option.go | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 client/quake/option.go (limited to 'client/quake/option.go') diff --git a/client/quake/option.go b/client/quake/option.go new file mode 100644 index 0000000..9c94fde --- /dev/null +++ b/client/quake/option.go @@ -0,0 +1,87 @@ +package quake + +import "log" + +type Option func(*Client) + +func WithName(name string) Option { + return func(c *Client) { + c.name = name + } +} + +func WithTeam(team string) Option { + return func(c *Client) { + c.team = team + } +} + +func WithSpectator(isSpectator bool) Option { + return func(c *Client) { + c.isSpectator = isSpectator + } +} + +func WithClientVersion(clientVersion string) Option { + return func(c *Client) { + c.clientVersion = clientVersion + } +} + +func WithServerAddr(addrPort string) Option { + return func(c *Client) { + c.addrPort = addrPort + } +} + +func WithPing(ping int16) Option { + return func(c *Client) { + c.ping = ping + } +} + +func WithBottomColor(color byte) Option { + return func(c *Client) { + c.bottomColor = color + } +} + +func WithTopColor(color byte) Option { + return func(c *Client) { + c.topColor = color + } +} + +func WithFTEExtensions(extensions uint32) Option { + return func(c *Client) { + c.fteEnabled = true + c.fteExtensions = extensions + } +} + +func WithFTE2Extensions(extensions uint32) Option { + return func(c *Client) { + c.fte2Enabled = true + c.fte2Extensions = extensions + } +} + +func WithMVDExtensions(extensions uint32) Option { + return func(c *Client) { + c.mvdEnabled = true + c.mvdExtensions = extensions + } +} + +func WithZQuakeExtensions(extensions uint32) Option { + return func(c *Client) { + c.zQuakeEnabled = true + c.zQuakeExtensions = extensions + } +} + +func WithLogger(logger *log.Logger) Option { + return func(c *Client) { + c.logger = logger + } +} -- cgit v1.2.3-59-g8ed1b