···2233import java.io.File;
4455+import assets.ui.BackgroundAsset;
66+import assets.ui.MapAsset;
77+import assets.ui.TexturesAsset;
88+59public class AssetHandle extends File
610{
711 public final File assetDir;
···3034 }
31353236 public String getAssetDescription() {
3737+ return null;
3838+ }
3939+4040+ /**
4141+ * Upgrades a plain AssetHandle to a typed subclass based on file extension.
4242+ * Returns null if the file doesn't match any known asset type.
4343+ */
4444+ public static AssetHandle upgrade(AssetHandle handle)
4545+ {
4646+ String name = handle.getAssetName();
4747+ if (name.endsWith(".xml")) return new MapAsset(handle);
4848+ if (name.endsWith(".png")) return new BackgroundAsset(handle);
4949+ if (name.endsWith(".json")) return new TexturesAsset(handle);
3350 return null;
3451 }
3552}