class_name GridOverlay extends TileMapLayer

const SOURCE_ID = 0
const HIGHLIGHT_SPRITE_ID = Vector2i(0,0)

@onready var targeting_selector: Sprite2D = $TargetingIndicator

func highlight_tile(coords: Vector2i) -> void:
	set_cell(coords, SOURCE_ID, HIGHLIGHT_SPRITE_ID)

func clear_tile(coords: Vector2i) -> void:
	set_cell(coords)
	
func target_tile(coords: Vector2i) -> void:
	targeting_selector.position = coords * tile_set.tile_size
	targeting_selector.visible = true
