#2 Collects resources

#8 Generates resources based on resource data
#10 Shows total resources and adjusts for new resources
This commit is contained in:
2024-02-07 09:22:14 -06:00
parent 7c81a2229e
commit 84de7fa6f1
10 changed files with 157 additions and 39 deletions

View File

@@ -9,8 +9,20 @@ var _pos: Vector2i
func _init(pos: Vector2i) -> void:
_pos = pos
func change_layer(layer: int, data: Variant) -> void:
func change_layer(layer: int, data: Variant) -> bool:
if layer_info.has(layer) and layer_info[layer] == data:
return false
layer_info[layer] = data
return true
func change_resource(data: GameResource) -> void:
layer_info[Constants.TilemapLayers.ENVIRONMENT] = data
func get_resource() -> GameResource:
return layer_info[Constants.TilemapLayers.ENVIRONMENT] as GameResource
func is_corrupted() -> bool:
return layer_info[Constants.TilemapLayers.CORRUPTION]
func has_layer(layer: int) -> bool:
return layer_info.has(layer)