2d位置接口抽离,添加3d位置接口

This commit is contained in:
kercylan98 2023-06-03 13:13:49 +08:00
parent b985fef3e3
commit fada9ce67a
3 changed files with 13 additions and 2 deletions

View File

@ -4,8 +4,7 @@ package game
// - AOI 对象提供了 AOI 系统中常用的属性,诸如位置坐标和视野范围等 // - AOI 对象提供了 AOI 系统中常用的属性,诸如位置坐标和视野范围等
type AOIEntity2D interface { type AOIEntity2D interface {
Actor Actor
// GetPosition 获取对象位置 Position2D
GetPosition() (x, y float64)
// GetVision 获取视距 // GetVision 获取视距
GetVision() float64 GetVision() float64
} }

7
game/position_2d.go Normal file
View File

@ -0,0 +1,7 @@
package game
// Position2D 2D位置接口定义
type Position2D interface {
// GetPosition 获取对象位置
GetPosition() (x, y float64)
}

5
game/position_3d.go Normal file
View File

@ -0,0 +1,5 @@
package game
type Position3D interface {
GetPosition() (x, y, z float64)
}