blob: 1d647309742e08cafa18b8ef39531d95c67ad20c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
package coffee.liz.abstractionengine.game
import androidx.compose.ui.graphics.ImageBitmap
/**
* Simple cache for loaded images.
* In a real game, you'd want more sophisticated resource management.
*/
class ImageCache {
private val images = mutableMapOf<String, ImageBitmap>()
fun loadImage(
path: String,
image: ImageBitmap,
) {
images[path] = image
}
fun getImage(path: String): ImageBitmap? = images[path]
fun clear() {
images.clear()
}
}
|