config

package
v0.23.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 9, 2019 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Divisions = []Division{DivA, DivB}

Division contain all known command enum constants

Functions

This section is empty.

Types

type Controller

type Controller struct {
	Network        Network `yaml:"network"`
	Game           Game    `yaml:"game"`
	Server         Server  `yaml:"server"`
	TimeFromVision bool    `yaml:"timeFromVision"`
}

Controller structure for the game controller

func DefaultControllerConfig

func DefaultControllerConfig() (c Controller)

DefaultControllerConfig creates a config with default values

func LoadControllerConfig

func LoadControllerConfig(fileName string) (config Controller, err error)

LoadControllerConfig loads a config from given file

type Division

type Division string
const (
	DivA Division = "DivA"
	DivB Division = "DivB"
)

func (Division) Valid added in v0.19.0

func (g Division) Valid() bool

Valid checks if the Division enum value is among the known values

type Game

type Game struct {
	YellowCardDuration        time.Duration              `yaml:"yellow-card-duration"`
	DefaultDivision           Division                   `yaml:"default-division"`
	Normal                    Special                    `yaml:"normal"`
	Overtime                  Special                    `yaml:"overtime"`
	TeamChoiceTimeout         time.Duration              `yaml:"team-choice-timeout"`
	DefaultGeometry           map[Division]*Geometry     `yaml:"default-geometry"`
	MultipleCardStep          int                        `yaml:"multiple-card-step"`
	MultipleFoulStep          int                        `yaml:"multiple-foul-step"`
	MultiplePlacementFailures int                        `yaml:"multiple-placement-failures"`
	MaxBots                   map[Division]int           `yaml:"max-bots"`
	AutoRefProposalTimeout    time.Duration              `yaml:"auto-ref-proposal-timeout"`
	FreeKickTime              map[Division]time.Duration `yaml:"free-kick-time"`
	GeneralTime               time.Duration              `yaml:"general-time"`
	BallPlacementTime         time.Duration              `yaml:"ball-placement-time"`
}

Game holds configs that are valid for the whole game

type Geometry

type Geometry struct {
	FieldLength                     float64 `yaml:"field-length"`
	FieldWidth                      float64 `yaml:"field-width"`
	DefenseAreaDepth                float64 `yaml:"defense-area-depth"`
	DefenseAreaWidth                float64 `yaml:"defense-area-width"`
	PlacementOffsetTouchLine        float64 `yaml:"placement-offset-touch-line"`
	PlacementOffsetGoalLine         float64 `yaml:"placement-offset-goal-line"`
	PlacementOffsetGoalLineGoalKick float64 `yaml:"placement-offset-goal-line-goal-kick"`
	PlacementOffsetDefenseArea      float64 `yaml:"placement-offset-defense-area"`
}

Geometry holds sizes of the field and distance for certain rules

type Network

type Network struct {
	PublishAddress string `yaml:"publish-address"`
	VisionAddress  string `yaml:"vision-address"`
}

Network holds configs for network communication

type Server

type Server struct {
	AutoRef ServerAutoRef `yaml:"auto-ref"`
	Team    ServerTeam    `yaml:"team"`
}

Server holds configs for the available server services

type ServerAutoRef

type ServerAutoRef struct {
	Address        string `yaml:"address"`
	AddressTls     string `yaml:"address-tls"`
	TrustedKeysDir string `yaml:"trusted-keys-dir"`
}

ServerAutoRef holds configs for the autoRef server

type ServerTeam

type ServerTeam struct {
	Address        string `yaml:"address"`
	AddressTls     string `yaml:"address-tls"`
	TrustedKeysDir string `yaml:"trusted-keys-dir"`
}

ServerTeam holds configs for the team server

type Special

type Special struct {
	HalfDuration     time.Duration `yaml:"half-duration"`
	HalfTimeDuration time.Duration `yaml:"half-time-duration"`
	TimeoutDuration  time.Duration `yaml:"timeout-duration"`
	Timeouts         int           `yaml:"timeouts"`
	BreakAfter       time.Duration `yaml:"break-after"`
}

Special holds configs that are different between normal and overtime halves

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL