flame-engine / flame

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

fix: Disallow mutatation of `SpriteAnimationGroupComponent.animations` #3183

Closed spydon closed 3 months ago

spydon commented 3 months ago

Description

Many users try to modify the SpriteAnimationGroupComponent.animations 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.

Checklist

Breaking Change?

Related Issues

erickzanardo commented 3 months ago

Is it the same way in the SpriteGroupComponent?

spydon commented 3 months ago

Is it the same way in the SpriteGroupComponent?

I thought it didn't, but it does!

spydon commented 3 months ago

@erickzanardo this is the follow-up to fix it for SpriteGroupComponent: https://github.com/flame-engine/flame/pull/3185

erickzanardo commented 3 months ago

@erickzanardo this is the follow-up to fix it for SpriteGroupComponent:

https://github.com/flame-engine/flame/pull/3185

Cool, I am both right and late hahahha