core/internal/domain/server_config.go

259 lines
4.8 KiB
Go
Raw Permalink Normal View History

package domain
type ServerConfigBuild struct {
Destroy int
}
type ServerConfigMisc struct {
KillRanking int
TradeCancelTime int
2024-02-10 12:28:41 +00:00
Tutorial int
}
type ServerConfigCommands struct {
CommandCancelTime int
2024-02-10 12:28:41 +00:00
MillisArrival int
}
type ServerConfigNewbie struct {
Days int
Ratio int
2024-02-10 12:28:41 +00:00
RatioDays int
RemoveNewbieVillages int
}
type ServerConfigGame struct {
Archer int
2024-02-10 12:28:41 +00:00
BarbarianMaxPoints int
BarbarianRise float64
BarbarianShrink int
2024-02-10 12:28:41 +00:00
BaseProduction int
BuildtimeFormula int
Church int
Event int
FakeLimit float64
FarmLimit int
Hauls int
HaulsBase int
HaulsMax int
2024-02-10 12:28:41 +00:00
Knight int
KnightNewItems int
Scavenging int
Stronghold int
SuppressEvents int
2024-02-10 12:28:41 +00:00
Tech int
Watchtower int
}
type ServerConfigBuildings struct {
CustomBarracks int
CustomChurch int
2024-02-10 12:28:41 +00:00
CustomFarm int
CustomGarage int
CustomHide int
2024-02-10 12:28:41 +00:00
CustomIron int
CustomMain int
CustomMarket int
CustomPlace int
CustomSmith int
CustomSnob int
2024-02-10 12:28:41 +00:00
CustomStable int
CustomStatue int
2024-02-10 12:28:41 +00:00
CustomStone int
CustomStorage int
CustomWall int
CustomWatchtower int
2024-02-10 12:28:41 +00:00
CustomWood int
}
type ServerConfigSnob struct {
CheapRebuild int
CoinIron int
2024-02-10 12:28:41 +00:00
CoinStone int
CoinWood int
Factor float64
Gold int
MaxDist int
NoBarbConquer int
2024-02-10 12:28:41 +00:00
Rise int
}
type ServerConfigAlly struct {
2024-02-10 12:28:41 +00:00
AllytimeSupport int
FixedAllies int
Levels int
Limit int
NoHarm int
2024-02-10 12:28:41 +00:00
NoJoin int
NoLeave int
NoOtherSupport int
NoOtherSupportType int
PointsMemberCount int
2024-02-10 12:28:41 +00:00
WarsAutoacceptDays int
WarsMemberRequirement int
WarsPointsRequirement int
XpRequirements string
}
type ServerConfigCoord struct {
BonusNew int
2024-02-10 12:28:41 +00:00
BonusVillages int
EmptyVillages int
Func int
Inner int
2024-02-10 12:28:41 +00:00
MapSize int
NobleRestart int
2024-02-10 12:28:41 +00:00
SelectStart int
StartVillages int
2024-02-10 12:28:41 +00:00
VillageMoveWait int
}
type ServerConfigSitter struct {
Allow int
}
type ServerConfigSleep struct {
Active int
Delay int
Max int
MaxAwake int
2024-02-10 12:28:41 +00:00
Min int
MinAwake int
WarnTime int
}
type ServerConfigNight struct {
Active int
DefFactor float64
Duration int
2024-02-10 12:28:41 +00:00
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
}