config.py 894 B

1234567891011121314151617181920212223242526272829
  1. # This Python file uses the following encoding: utf-8
  2. # @author runhey
  3. # github https://github.com/runhey
  4. from enum import Enum
  5. from pydantic import BaseModel, Field
  6. from tasks.Component.config_base import ConfigBase, Time
  7. from tasks.Component.config_scheduler import Scheduler
  8. class Strategy(str, Enum):
  9. Majority = 'frog_majority'
  10. Minority = 'frog_minority'
  11. Bilibili = 'frog_bilibili'
  12. Dashen = 'frog_dashen'
  13. AlwaysRed = 'frog_always_red'
  14. AlwaysBlue = 'frog_always_blue'
  15. class FrogBossConfig(ConfigBase):
  16. before_end_frog: Time = Field(default=Time(0, 15, 0), description='before_end_frog_help')
  17. strategy_frog: Strategy = Field(default=Strategy.Majority, description='strategy_frog_help')
  18. class FrogBoss(ConfigBase):
  19. scheduler: Scheduler = Field(default_factory=Scheduler)
  20. frog_boss_config: FrogBossConfig = Field(default_factory=FrogBossConfig)