Initial flame_lua_runtime package
This commit is contained in:
28
lib/runtime/resources/game_resource_debug.dart
Normal file
28
lib/runtime/resources/game_resource_debug.dart
Normal file
@@ -0,0 +1,28 @@
|
||||
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(),
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user