|
|
|
@ -7,6 +7,7 @@ const SIZE := 32 # blocks |
|
|
|
|
signal clean |
|
|
|
|
|
|
|
|
|
var chunk_pos: Vector2i |
|
|
|
|
var region: BlockRegion |
|
|
|
|
var dirty := false |
|
|
|
|
|
|
|
|
|
var tracked_by: Dictionary[ChunkLoader, Variant] # value is unused |
|
|
|
@ -19,6 +20,11 @@ func get_players_tracking() -> Array[Player]: |
|
|
|
|
|
|
|
|
|
func _init(chunk_pos: Vector2i) -> void: |
|
|
|
|
self.chunk_pos = chunk_pos |
|
|
|
|
|
|
|
|
|
var min := chunk_pos * Chunk.SIZE |
|
|
|
|
var max := (chunk_pos + Vector2i.ONE) * Chunk.SIZE - Vector2i.ONE |
|
|
|
|
region = BlockRegion.new(min, max) |
|
|
|
|
|
|
|
|
|
name = "Chunk %s" % chunk_pos |
|
|
|
|
position = (Vector2(chunk_pos) + Vector2.ONE / 2) * (Block.SIZE * SIZE) |
|
|
|
|
|
|
|
|
|