package domain

type ServerConfigBuild struct {
	Destroy int
}

type ServerConfigMisc struct {
	KillRanking     int
	TradeCancelTime int
	Tutorial        int
}

type ServerConfigCommands struct {
	CommandCancelTime int
	MillisArrival     int
}

type ServerConfigNewbie struct {
	Days                 int
	Ratio                int
	RatioDays            int
	RemoveNewbieVillages int
}

type ServerConfigGame struct {
	Archer             int
	BarbarianMaxPoints int
	BarbarianRise      float64
	BarbarianShrink    int
	BaseProduction     int
	BuildtimeFormula   int
	Church             int
	Event              int
	FakeLimit          float64
	FarmLimit          int
	Hauls              int
	HaulsBase          int
	HaulsMax           int
	Knight             int
	KnightNewItems     int
	Scavenging         int
	Stronghold         int
	SuppressEvents     int
	Tech               int
	Watchtower         int
}

type ServerConfigBuildings struct {
	CustomBarracks   int
	CustomChurch     int
	CustomFarm       int
	CustomGarage     int
	CustomHide       int
	CustomIron       int
	CustomMain       int
	CustomMarket     int
	CustomPlace      int
	CustomSmith      int
	CustomSnob       int
	CustomStable     int
	CustomStatue     int
	CustomStone      int
	CustomStorage    int
	CustomWall       int
	CustomWatchtower int
	CustomWood       int
}

type ServerConfigSnob struct {
	CheapRebuild  int
	CoinIron      int
	CoinStone     int
	CoinWood      int
	Factor        float64
	Gold          int
	MaxDist       int
	NoBarbConquer int
	Rise          int
}

type ServerConfigAlly struct {
	AllytimeSupport       int
	FixedAllies           int
	Levels                int
	Limit                 int
	NoHarm                int
	NoJoin                int
	NoLeave               int
	NoOtherSupport        int
	NoOtherSupportType    int
	PointsMemberCount     int
	WarsAutoacceptDays    int
	WarsMemberRequirement int
	WarsPointsRequirement int
	XpRequirements        string
}

type ServerConfigCoord struct {
	BonusNew        int
	BonusVillages   int
	EmptyVillages   int
	Func            int
	Inner           int
	MapSize         int
	NobleRestart    int
	SelectStart     int
	StartVillages   int
	VillageMoveWait int
}

type ServerConfigSitter struct {
	Allow int
}

type ServerConfigSleep struct {
	Active   int
	Delay    int
	Max      int
	MaxAwake int
	Min      int
	MinAwake int
	WarnTime int
}

type ServerConfigNight struct {
	Active    int
	DefFactor float64
	Duration  int
	EndHour   int
	StartHour int
}

type ServerConfigWin struct {
	Check int
}

type ServerConfig struct {
	speed     float64
	unitSpeed float64
	moral     int
	build     ServerConfigBuild
	misc      ServerConfigMisc
	commands  ServerConfigCommands
	newbie    ServerConfigNewbie
	game      ServerConfigGame
	buildings ServerConfigBuildings
	snob      ServerConfigSnob
	ally      ServerConfigAlly
	coord     ServerConfigCoord
	sitter    ServerConfigSitter
	sleep     ServerConfigSleep
	night     ServerConfigNight
	win       ServerConfigWin
}

type NullServerConfig = NullValue[ServerConfig]

func NewServerConfig(
	speed float64,
	unitSpeed float64,
	moral int,
	build ServerConfigBuild,
	misc ServerConfigMisc,
	commands ServerConfigCommands,
	newbie ServerConfigNewbie,
	game ServerConfigGame,
	buildings ServerConfigBuildings,
	snob ServerConfigSnob,
	ally ServerConfigAlly,
	coord ServerConfigCoord,
	sitter ServerConfigSitter,
	sleep ServerConfigSleep,
	night ServerConfigNight,
	win ServerConfigWin,
) (ServerConfig, error) {
	return ServerConfig{
		speed:     speed,
		unitSpeed: unitSpeed,
		moral:     moral,
		build:     build,
		misc:      misc,
		commands:  commands,
		newbie:    newbie,
		game:      game,
		buildings: buildings,
		snob:      snob,
		ally:      ally,
		coord:     coord,
		sitter:    sitter,
		sleep:     sleep,
		night:     night,
		win:       win,
	}, nil
}

func (s ServerConfig) Speed() float64 {
	return s.speed
}

func (s ServerConfig) UnitSpeed() float64 {
	return s.unitSpeed
}

func (s ServerConfig) Moral() int {
	return s.moral
}

func (s ServerConfig) Build() ServerConfigBuild {
	return s.build
}

func (s ServerConfig) Misc() ServerConfigMisc {
	return s.misc
}

func (s ServerConfig) Commands() ServerConfigCommands {
	return s.commands
}

func (s ServerConfig) Newbie() ServerConfigNewbie {
	return s.newbie
}

func (s ServerConfig) Game() ServerConfigGame {
	return s.game
}

func (s ServerConfig) Buildings() ServerConfigBuildings {
	return s.buildings
}

func (s ServerConfig) Snob() ServerConfigSnob {
	return s.snob
}

func (s ServerConfig) Ally() ServerConfigAlly {
	return s.ally
}

func (s ServerConfig) Coord() ServerConfigCoord {
	return s.coord
}

func (s ServerConfig) Sitter() ServerConfigSitter {
	return s.sitter
}

func (s ServerConfig) Sleep() ServerConfigSleep {
	return s.sleep
}

func (s ServerConfig) Night() ServerConfigNight {
	return s.night
}

func (s ServerConfig) Win() ServerConfigWin {
	return s.win
}
