aoi

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EntityJoinVisionEventHandle

type EntityJoinVisionEventHandle[E TwoDimensionalEntity] func(entity, target E)

type EntityLeaveVisionEventHandle

type EntityLeaveVisionEventHandle[E TwoDimensionalEntity] func(entity, target E)

type TwoDimensional

type TwoDimensional[E TwoDimensionalEntity] struct {
	// contains filtered or unexported fields
}

func NewTwoDimensional

func NewTwoDimensional[E TwoDimensionalEntity](width, height, areaWidth, areaHeight int) *TwoDimensional[E]

func (*TwoDimensional[E]) AddEntity

func (slf *TwoDimensional[E]) AddEntity(entity E)

func (*TwoDimensional[E]) DeleteEntity

func (slf *TwoDimensional[E]) DeleteEntity(entity E)

func (*TwoDimensional[E]) GetFocus

func (slf *TwoDimensional[E]) GetFocus(guid int64) map[int64]E

func (TwoDimensional) OnEntityJoinVisionEvent

func (slf TwoDimensional) OnEntityJoinVisionEvent(entity, target E)

OnEntityJoinVisionEvent 在新对象进入视野时将会立刻执行被注册的事件处理函数

func (TwoDimensional) OnEntityLeaveVisionEvent

func (slf TwoDimensional) OnEntityLeaveVisionEvent(entity, target E)

OnEntityLeaveVisionEvent 在新对象离开视野时将会立刻执行被注册的事件处理函数

func (*TwoDimensional[E]) Refresh

func (slf *TwoDimensional[E]) Refresh(entity E)

func (TwoDimensional) RegEntityJoinVisionEvent

func (slf TwoDimensional) RegEntityJoinVisionEvent(handle EntityJoinVisionEventHandle[E])

RegEntityJoinVisionEvent 在新对象进入视野时将会立刻执行被注册的事件处理函数

func (TwoDimensional) RegEntityLeaveVisionEvent

func (slf TwoDimensional) RegEntityLeaveVisionEvent(handle EntityLeaveVisionEventHandle[E])

RegEntityLeaveVisionEvent 在新对象离开视野时将会立刻执行被注册的事件处理函数

func (*TwoDimensional[E]) SetAreaSize

func (slf *TwoDimensional[E]) SetAreaSize(width, height int)

func (*TwoDimensional[E]) SetSize

func (slf *TwoDimensional[E]) SetSize(width, height int)

type TwoDimensionalEntity

type TwoDimensionalEntity interface {
	game.Actor
	game.Position2D
	// GetVision 获取视距
	GetVision() float64
}

TwoDimensionalEntity 基于2D定义的AOI对象功能接口

  • AOI 对象提供了 AOI 系统中常用的属性,诸如位置坐标和视野范围等

Jump to

Keyboard shortcuts

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