Documentation ¶
Index ¶
Constants ¶
View Source
const EnergyLoss = 0.96
View Source
const GlobalDumping = 0.98
Variables ¶
View Source
var PlayersArgentina = []string{"Crespo", "Messi", "Ricardo", "Carrizo", "Labruna", "Batistuta", "Ubaldo", "Kempes", "Passarella", "Maradona"}
View Source
var PlayersBrazil = []string{"Gérson", "Tostão", "Zico", "Rivaldo", "Jairzinho", "Ronaldo", "Carlos Alberto", "Didi", "Garrincha", "Pelé"}
Functions ¶
func GetBallInputChannel ¶
func GetBallInputChannel() <-chan *Ball
func GetBallOutputChannel ¶
func GetBallOutputChannel() chan<- *Ball
func GetPlayerName ¶
Types ¶
type Ball ¶
type Ball struct { X float64 `json:"x"` Y float64 `json:"y"` Vx float64 `json:"v_x"` Vy float64 `json:"v_y"` Z float64 `json:"z"` Vz float64 `json:"vz"` LastPlayer string `json:"last_player"` LastTeam int `json:"last_team"` LastUpdated time.Time `json:"last_updated"` HolderID string `json:"holder_id"` HolderTeam Team `json:"holder_team"` LastKick time.Time `json:"last_kick"` }
func (*Ball) ApplyKinematics ¶
func (b *Ball) ApplyKinematics()
func (*Ball) GetDisplayStatus ¶
func (b *Ball) GetDisplayStatus() *DisplayStatus
func (*Ball) GetSurfaceVelocity ¶
type DisplayStatus ¶
type DisplayStatusProvider ¶
type DisplayStatusProvider interface {
GetDisplayStatus() *DisplayStatus
}
type DisplayStatusType ¶
type DisplayStatusType string
const ( TypeBall DisplayStatusType = "ball" TypePlayer DisplayStatusType = "player" )
type GameField ¶
func NewGameField ¶
func NewGameField() *GameField
func (*GameField) MarshalJSON ¶
func (*GameField) Update ¶
func (gf *GameField) Update(item *DisplayStatus)
type Player ¶
type Player struct { X float64 Y float64 TeamID Team ID string Name string MaxVelocity float64 LastKick time.Time // contains filtered or unexported fields }
func (*Player) Activate ¶
func (p *Player) Activate(displayChannel chan<- *DisplayStatus, wg *sync.WaitGroup)
func (*Player) GetDisplayStatus ¶
func (p *Player) GetDisplayStatus() *DisplayStatus
Click to show internal directories.
Click to hide internal directories.