-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: 重构 aoi 包实现,移除对 game.Actor、game.Position2D 等接口的依赖
- Loading branch information
1 parent
af0165a
commit d56ebde
Showing
4 changed files
with
90 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
package aoi | ||
|
||
import "github.com/kercylan98/minotaur/game" | ||
import ( | ||
"github.com/kercylan98/minotaur/utils/generic" | ||
"github.com/kercylan98/minotaur/utils/geometry" | ||
) | ||
|
||
// TwoDimensionalEntity 基于2D定义的AOI对象功能接口 | ||
// - AOI 对象提供了 AOI 系统中常用的属性,诸如位置坐标和视野范围等 | ||
type TwoDimensionalEntity interface { | ||
game.Actor | ||
game.Position2D | ||
type TwoDimensionalEntity[EID generic.Basic, PosType generic.SignedNumber] interface { | ||
// GetTwoDimensionalEntityID 获取 AOI 对象 ID | ||
GetTwoDimensionalEntityID() EID | ||
// GetVision 获取视距 | ||
GetVision() float64 | ||
// GetPosition 获取位置 | ||
GetPosition() geometry.Point[PosType] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters