flame-engine / flame

A Flutter based game engine.
https://flame-engine.org
MIT License
8.98k stars 879 forks source link

fix: Disallow mutatation of `SpriteGroupComponent.sprites` #3185

Closed spydon closed 1 month ago

spydon commented 1 month ago

Description

Many users try to modify the SpriteGroupComponent.sprites map, but that doesn't work since it has to go through the setter, so this PR makes the returned map from the getter unmodifiable. You can either set it by using the setter or set a particular sprite by using the newly created updateSprite method.

Checklist

Breaking Change?

Related Issues