hexMap

package
v0.0.0-...-1208f85 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2016 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HexMap

type HexMap struct {
	// contains filtered or unexported fields
}

func NewHexMap

func NewHexMap(c client.GameConfig, visualize bool) *HexMap

func (*HexMap) DetectEnemyBot

func (h *HexMap) DetectEnemyBot(botId int, pos client.Position)

func (*HexMap) GetBotRadaringPoint

func (h *HexMap) GetBotRadaringPoint(botId int) client.Position

func (*HexMap) GetCannonPosition

func (h *HexMap) GetCannonPosition(pos client.Position) client.Position

func (*HexMap) GetStartPoints

func (h *HexMap) GetStartPoints(botCount int) (points []int)

func (*HexMap) GetValidCannons

func (h *HexMap) GetValidCannons(botId int) []client.Position

Get valid positios where bot can use cannon

func (*HexMap) GetValidMoves

func (h *HexMap) GetValidMoves(botId int) []client.Position

Get valid positios where bot can move

func (*HexMap) GetValidRadars

func (h *HexMap) GetValidRadars(botId int) []client.Position

Get valid positios where bot can use rader

func (*HexMap) HitBot

func (h *HexMap) HitBot(botId, damage int)

func (*HexMap) MoveMyBot

func (h *HexMap) MoveMyBot(botId int, pos client.Position)

func (*HexMap) Radar

func (h *HexMap) Radar(pos *client.Position)

func (*HexMap) Reduce

func (h *HexMap) Reduce()

This will be called first thing on each round We should use flood fill, etc. to keep map up to date

func (*HexMap) Run

func (h *HexMap) Run(botId int) client.Position

Get run away move 1. Get all valid moves for bot 2. Filter bad moves out 3. Get random move from best moves 4. If no best move get one from valid ones

func (*HexMap) RunTowardsPosition

func (h *HexMap) RunTowardsPosition(botId int, target client.Position) client.Position

Start running towards desirect position

func (*HexMap) Send

func (h *HexMap) Send()

The json serialization is terrible here

func (*HexMap) SetMyBot

func (h *HexMap) SetMyBot(bot *client.Bot, radarIdx int)

func (*HexMap) ShootAround

func (h *HexMap) ShootAround(p client.Position, bots int, filter *client.Position) []client.Position

use this only for 1 or 2 bots

func (*HexMap) Stay

func (h *HexMap) Stay(botId int)

func (*HexMap) WillDamageGivenBot

func (h *HexMap) WillDamageGivenBot(x, y int, p *client.Position) bool

func (*HexMap) WillDamageOwnBot

func (h *HexMap) WillDamageOwnBot(x, y int) bool

type Info

type Info struct {
	Map  []InfoPoint  `json:"map"`
	Bots []client.Bot `json:"bots"`
}

type InfoPoint

type InfoPoint struct {
	X      int   `json:"x"`
	Y      int   `json:"y"`
	Probed bool  `json:"probed"`
	Bots   []int `json:"bots"`
}

type Point

type Point struct {
	PossibleBots map[int]bool
	Probed       bool
}

Jump to

Keyboard shortcuts

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