merged entity/chunk && entity/chunkposition

This commit is contained in:
CPunch 2023-12-01 17:03:46 -06:00
parent bcc999db38
commit e1804a1042
2 changed files with 14 additions and 15 deletions

View File

@ -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{}

View File

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