From e1804a1042e3961caa8dffdbfdc29ce5bba12557 Mon Sep 17 00:00:00 2001 From: CPunch Date: Fri, 1 Dec 2023 17:03:46 -0600 Subject: [PATCH] merged entity/chunk && entity/chunkposition --- shard/entity/chunk.go | 14 ++++++++++++++ shard/entity/chunkposition.go | 15 --------------- 2 files changed, 14 insertions(+), 15 deletions(-) delete mode 100644 shard/entity/chunkposition.go diff --git a/shard/entity/chunk.go b/shard/entity/chunk.go index fdd2cd7..6e58e49 100644 --- a/shard/entity/chunk.go +++ b/shard/entity/chunk.go @@ -3,8 +3,22 @@ package entity import ( "log" "sync" + + "github.com/CPunch/gopenfusion/config" ) +type ChunkPosition struct { + X int + Y int +} + +func MakeChunkPosition(x, y int) ChunkPosition { + return ChunkPosition{ + X: x / (config.VIEW_DISTANCE / 3), + Y: y / (config.VIEW_DISTANCE / 3), + } +} + type Chunk struct { Position ChunkPosition entities map[Entity]struct{} diff --git a/shard/entity/chunkposition.go b/shard/entity/chunkposition.go deleted file mode 100644 index e27016f..0000000 --- a/shard/entity/chunkposition.go +++ /dev/null @@ -1,15 +0,0 @@ -package entity - -import "github.com/CPunch/gopenfusion/config" - -type ChunkPosition struct { - X int - Y int -} - -func MakeChunkPosition(x, y int) ChunkPosition { - return ChunkPosition{ - X: x / (config.VIEW_DISTANCE / 3), - Y: y / (config.VIEW_DISTANCE / 3), - } -}