From fada9ce67a900895aeb6aeb3b71141601cc161f1 Mon Sep 17 00:00:00 2001 From: kercylan98 Date: Sat, 3 Jun 2023 13:13:49 +0800 Subject: [PATCH] =?UTF-8?q?2d=E4=BD=8D=E7=BD=AE=E6=8E=A5=E5=8F=A3=E6=8A=BD?= =?UTF-8?q?=E7=A6=BB=EF=BC=8C=E6=B7=BB=E5=8A=A03d=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game/aoi2d_entity.go | 3 +-- game/position_2d.go | 7 +++++++ game/position_3d.go | 5 +++++ 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 game/position_2d.go create mode 100644 game/position_3d.go diff --git a/game/aoi2d_entity.go b/game/aoi2d_entity.go index debe2d8..1e6aede 100644 --- a/game/aoi2d_entity.go +++ b/game/aoi2d_entity.go @@ -4,8 +4,7 @@ package game // - AOI 对象提供了 AOI 系统中常用的属性,诸如位置坐标和视野范围等 type AOIEntity2D interface { Actor - // GetPosition 获取对象位置 - GetPosition() (x, y float64) + Position2D // GetVision 获取视距 GetVision() float64 } diff --git a/game/position_2d.go b/game/position_2d.go new file mode 100644 index 0000000..d48ad67 --- /dev/null +++ b/game/position_2d.go @@ -0,0 +1,7 @@ +package game + +// Position2D 2D位置接口定义 +type Position2D interface { + // GetPosition 获取对象位置 + GetPosition() (x, y float64) +} diff --git a/game/position_3d.go b/game/position_3d.go new file mode 100644 index 0000000..4a7fc20 --- /dev/null +++ b/game/position_3d.go @@ -0,0 +1,5 @@ +package game + +type Position3D interface { + GetPosition() (x, y, z float64) +}