mirror of
https://github.com/CPunch/gopenfusion.git
synced 2024-11-23 15:50:10 +00:00
merged entity/chunk && entity/chunkposition
This commit is contained in:
parent
bcc999db38
commit
e1804a1042
@ -3,8 +3,22 @@ package entity
|
|||||||
import (
|
import (
|
||||||
"log"
|
"log"
|
||||||
"sync"
|
"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 {
|
type Chunk struct {
|
||||||
Position ChunkPosition
|
Position ChunkPosition
|
||||||
entities map[Entity]struct{}
|
entities map[Entity]struct{}
|
||||||
|
@ -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),
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user