aoi

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2018 License: MIT Imports: 1 Imported by: 23

README

go-aoi

Golang Area-Of-Interest (AOI) Implementations

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitAOI

func InitAOI(aoi *AOI, dist Coord, data interface{}, callback AOICallback)

Types

type AOI

type AOI struct {
	Data interface{}
	// contains filtered or unexported fields
}

type AOICallback

type AOICallback interface {
	OnEnterAOI(other *AOI)
	OnLeaveAOI(other *AOI)
}

type AOIManager

type AOIManager interface {
	Enter(aoi *AOI, x, y Coord)
	Leave(aoi *AOI)
	Moved(aoi *AOI, x, y Coord)
}

func NewTowerAOIManager

func NewTowerAOIManager(minX, maxX, minY, maxY Coord, towerRange Coord) AOIManager

func NewXZListAOIManager added in v0.1.0

func NewXZListAOIManager(aoidist Coord) AOIManager

NewXZListAOIManager creates a new XZListAOIManager

type AOISet

type AOISet map[*AOI]struct{}

func (AOISet) Add

func (s AOISet) Add(aoi *AOI)

func (AOISet) Contains

func (s AOISet) Contains(aoi *AOI) (ok bool)

func (AOISet) Remove

func (s AOISet) Remove(aoi *AOI)

type Coord

type Coord float32

Coord is the type for coordinate axes values

type TowerAOIManager

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

func (*TowerAOIManager) Enter

func (aoiman *TowerAOIManager) Enter(aoi *AOI, x, y Coord)

func (*TowerAOIManager) Leave

func (aoiman *TowerAOIManager) Leave(aoi *AOI)

func (*TowerAOIManager) Moved

func (aoiman *TowerAOIManager) Moved(aoi *AOI, x, y Coord)

type XZListAOIManager

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

XZListAOIManager is an implementation of AOICalculator using XZ lists

func (*XZListAOIManager) Enter

func (aoiman *XZListAOIManager) Enter(aoi *AOI, x, y Coord)

Enter is called when Entity enters Space

func (*XZListAOIManager) Leave

func (aoiman *XZListAOIManager) Leave(aoi *AOI)

Leave is called when Entity leaves Space

func (*XZListAOIManager) Moved

func (aoiman *XZListAOIManager) Moved(aoi *AOI, x, y Coord)

Moved is called when Entity moves in Space

Jump to

Keyboard shortcuts

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