bot

package
v2.0.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2022 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FieldGridCols = 10
	FieldGridRows = 8
)

if you change the number of cols/rows you must update the roleMap variable!

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot

type Bot struct {
	Role Role
	// contains filtered or unexported fields
}

func NewBot

func NewBot(logger lugo4go.Logger, side proto.Team_Side, number uint32) *Bot

func (*Bot) AsGoalkeeper

func (b *Bot) AsGoalkeeper(ctx context.Context, sender lugo4go.TurnOrdersSender, snapshot *proto.GameSnapshot, myState lugo4go.PlayerState) error

func (*Bot) MyInitialPosition

func (b *Bot) MyInitialPosition() *proto.Point

func (*Bot) OnDefending

func (b *Bot) OnDefending(ctx context.Context, sender lugo4go.TurnOrdersSender, snapshot *proto.GameSnapshot) error

func (*Bot) OnDisputing

func (b *Bot) OnDisputing(ctx context.Context, sender lugo4go.TurnOrdersSender, snapshot *proto.GameSnapshot) error

func (*Bot) OnHolding

func (b *Bot) OnHolding(ctx context.Context, sender lugo4go.TurnOrdersSender, snapshot *proto.GameSnapshot) error

func (*Bot) OnSupporting

func (b *Bot) OnSupporting(ctx context.Context, sender lugo4go.TurnOrdersSender, snapshot *proto.GameSnapshot) error

type PlayerActionRegions

type PlayerActionRegions map[TeamState]RegionCode

func DefinePlayerActionRegions

func DefinePlayerActionRegions(number uint32) PlayerActionRegions

type RegionCode

type RegionCode struct {
	Col uint8
	Row uint8
}

type Role

type Role string
const (
	Defense Role = "defense"
	Middle  Role = "middle"
	Attack  Role = "attack"
)

func DefineRole

func DefineRole(number uint32) Role

type TeamState

type TeamState string
const (
	Initial       TeamState = "initial"
	UnderPressure TeamState = "under-pressure"
	Defensive     TeamState = "defensive"
	Neutral       TeamState = "neutral"
	Offensive     TeamState = "offensive"
	OnAttack      TeamState = "on-attack"
)

func DetermineTeamState

func DetermineTeamState(ballRegion field.Region, myTeamSide, possession proto.Team_Side) (s TeamState, e error)

Jump to

Keyboard shortcuts

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