Made building consume resources
Now may build more than one if resources allow building placement is red/green for indicating success
This commit is contained in:
@@ -25,6 +25,9 @@ func change_layer(layer: int, data: Variant) -> bool:
|
||||
func change_resource(data: GameResource) -> void:
|
||||
layer_info[Constants.TilemapLayers.ENVIRONMENT] = data
|
||||
|
||||
func change_building(data: BuildingBase) -> void:
|
||||
layer_info[Constants.TilemapLayers.BUILDINGS] = data
|
||||
|
||||
func get_resource() -> GameResource:
|
||||
return layer_info[Constants.TilemapLayers.ENVIRONMENT] as GameResource
|
||||
|
||||
@@ -44,7 +47,7 @@ func is_interactable() -> bool:
|
||||
return has_resource() or has_building()
|
||||
|
||||
func is_buildable() -> bool:
|
||||
return not has_resource() or not has_building()
|
||||
return not has_resource() and not has_building()
|
||||
|
||||
func get_interaction_options() -> Array[Interaction]:
|
||||
var interactions: Array[Interaction] = []
|
||||
|
||||
Reference in New Issue
Block a user