18 lines
600 B
GDScript
18 lines
600 B
GDScript
extends Node
|
|
|
|
var _resource_buildings = {}
|
|
var _storage_buildings = {}
|
|
|
|
func add_resource_building(res: GameResource, building: BuildingBase) -> void:
|
|
if not _resource_buildings.has(res):
|
|
_resource_buildings[res] = []
|
|
_resource_buildings[res].append(building)
|
|
|
|
func add_storage_building(res: GameResource, building: BuildingBase) -> void:
|
|
if not _storage_buildings.has(res):
|
|
_storage_buildings[res] = []
|
|
_storage_buildings[res].append(building)
|
|
|
|
func get_storage_count_for_resource(res: GameResource) -> int:
|
|
return 0 if not _storage_buildings.has(res) else _storage_buildings[res].size()
|