duncgibbs a9352d337d
Some checks failed
linting & formatting / build (push) Failing after 24s
way too many changes; multiplayer version, like, 0.6 or 0.7
2026-04-20 13:03:39 -05:00

34 lines
677 B
GDScript

class_name Tile extends Node2D
@warning_ignore("unused_signal")
signal tile_selected(tile: Tile)
@export var coords: Vector2i
@export var cost: int = 0
var highlighted: bool = false
var is_placing: bool = false
func handle_mouse_entered() -> void:
highlighted = true
func handle_mouse_exited() -> void:
highlighted = false
func serialize() -> Dictionary:
var result = {}
result["scene_file_path"] = scene_file_path
result["coords"] = coords
result["cost"] = cost
return result
static func deserialize(data: Dictionary) -> Tile:
var tile: Tile = load(data["scene_file_path"]).instantiate()
tile.coords = data["coords"]
tile.cost = data["cost"]
return tile