package live_logic import "dcg/pkg/cmd" type ( LogicOption func(logic LiveLogic) ) func WithGameType(gameType string) LogicOption { return func(logic LiveLogic) { logic.SetGameType(gameType) } } func WithPreDanmakuHandler(handler PreDanmakuHandlerFunc) LogicOption { return func(logic LiveLogic) { logic.SetPreDanmakuHandler(handler) } } func WithCmdParser(parser *cmd.Parser) LogicOption { return func(logic LiveLogic) { logic.SetCmdParser(parser) } } func WithGiftHandler(handler GiftHandler) LogicOption { return func(logic LiveLogic) { logic.RegisterGiftHandler(handler) } } func WithNobilityHandler(handler NobilityHandlerFunc) LogicOption { return func(logic LiveLogic) { logic.RegisterNobilityHandler(handler) } } func WithCmdHandler(handler CMDHandlerFunc, prefix string, alias ...string) LogicOption { return func(logic LiveLogic) { logic.RegisterCMDHandler(handler, prefix, alias...) } }