29 lines
1018 B
Dart
29 lines
1018 B
Dart
part of 'game_resource_manager.dart';
|
|
|
|
extension _GameResourceManagerDebug on GameResourceManager {
|
|
Map<String, Object?> _imageRecordDebugJson({
|
|
required String? key,
|
|
required String path,
|
|
required String? preload,
|
|
required bool declared,
|
|
}) {
|
|
final record = _images[path];
|
|
return {
|
|
if (key != null) 'key': key,
|
|
'path': path,
|
|
'type': GameResourceType.image,
|
|
'declared': declared,
|
|
if (preload != null) 'preload': preload,
|
|
if (key != null && _package?.manifest.resources[key]?.group != null)
|
|
'group': _package?.manifest.resources[key]?.group,
|
|
'state': (record?.state ?? GameResourceState.idle).name,
|
|
if (record != null) 'generation': record.generation,
|
|
'loading': record?.inflight != null,
|
|
'ready': record?.image != null,
|
|
if (record != null) 'refCount': record.refCount,
|
|
if (record != null) 'bytes': record.estimatedBytes,
|
|
if (record?.lastError != null) 'error': record!.lastError.toString(),
|
|
};
|
|
}
|
|
}
|