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), - } -}