Class GBAssetResolver
- Namespace
- GridPlacement.GDScript
- Assembly
- MoonBark.GridPlacement.GDScript.dll
Centralized asset resolver for loading Grid Building resources from folders.\n\nProvides unified loading functionality for placeables, category tags, and other Grid Building assets. Supports both folder-based loading and individual asset arrays. Handles resource validation and provides consistent error handling across the plugin.
class GBAssetResolver extends RefCounted
GBAssetResolver
Properties
assets
Result structure for asset loading operations
var assets: Array = []
errors
var errors: Array[String] = []
warnings
var warnings: Array[String] = []
parts
var parts: Array[String] = []
result
var result = SingleAssetResult.new()
typed_result
var typed_result: Array[PlaceableSequence] = []
result
var result = SingleAssetResult.new()
typed_result
var typed_result: Array[PlaceableSequence] = []
result
var result = SingleAssetResult.new()
typed_result
var typed_result: Array[PlaceableSequence] = []
result
var result = SingleAssetResult.new()
folder_result
var folder_result = _load_from_folder(folder_path, asset_type)
result
var result = SingleAssetResult.new()
entries
var entries = ResourceLoader.list_directory(folder_path)
sub_path
var sub_path = folder_path.path_join(entry)
sub_result
var sub_result = _load_from_folder(sub_path, asset_type)
full_path
var full_path = folder_path.path_join(entry)
load_result
var load_result = _load_single_asset(full_path, asset_type, true)
asset
Result structure for single asset loading
var asset: Resource = null
errors
var errors: Array[String] = []
result
var result = SingleAssetResult.new()
resource
var resource = ResourceLoader.load(file_path)
is_correct_type
var is_correct_type = false
expected_class_name
var expected_class_name = expected_type.get_global_name()
expected_name
var expected_name = expected_type.get_global_name() if expected_type.get_global_name() != "" else str(expected_type)
message
var message = "Resource type mismatch in '%s': expected %s, got %s" % [file_path, expected_name, resource.get_class()]
diagnostics
var diagnostics = {
entries
var entries = ResourceLoader.list_directory(folder_path)
Methods
is_successful
func is_successful() -> bool:
Returns
has_warnings
func has_warnings() -> bool:
Returns
get_summary
func get_summary() -> String:
Returns
load_placeables
static func load_placeables(folder_path: String, individual_placeables: Array[Placeable] = []) -> Array[Placeable]:
Parameters
folder_pathindividual_placeables
Returns
load_placeables_with_result
static func load_placeables_with_result(folder_path: String, individual_placeables: Array[Placeable] = []) -> LoadResult:
Parameters
folder_pathindividual_placeables
Returns
load_category_tags
static func load_category_tags(folder_path: String, individual_tags: Array[CategoricalTag] = []) -> Array[CategoricalTag]:
Parameters
folder_pathindividual_tags
Returns
load_category_tags_with_result
static func load_category_tags_with_result(folder_path: String, individual_tags: Array[CategoricalTag] = []) -> LoadResult:
Parameters
folder_pathindividual_tags
Returns
load_placeable_sequences
static func load_placeable_sequences(folder_path: String, individual_sequences: Array[PlaceableSequence] = []) -> Array[PlaceableSequence]:
Parameters
folder_pathindividual_sequences
Returns
load_placeable_sequences_with_result
static func load_placeable_sequences_with_result(folder_path: String, individual_sequences: Array[PlaceableSequence] = []) -> LoadResult:
Parameters
folder_pathindividual_sequences
Returns
load_assets_of_type
static func load_assets_of_type(folder_path: String, asset_type: GDScript, individual_assets: Array = []) -> LoadResult:
Parameters
folder_pathasset_typeindividual_assets
Returns
validate_folder_path
static func validate_folder_path(folder_path: String) -> bool:
Parameters
folder_path
Returns
get_folder_diagnostics
static func get_folder_diagnostics(folder_path: String) -> Dictionary:
Parameters
folder_path