#2 Collects resources
#8 Generates resources based on resource data #10 Shows total resources and adjusts for new resources
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user