itdelatrisu / opsu

opsu! ~ an open-source osu! client
https://itdelatrisu.github.io/opsu/
GNU General Public License v3.0
763 stars 123 forks source link

Suggestion for DelayedFadeOutTransition and EasedFadeOutTransition classes #549

Open PaulDBM opened 3 years ago

PaulDBM commented 3 years ago

Hi! I noticed that in the source code of the DelayedFadeOutTransition and EasedFadeOutTransition classes you could apply the Decorator design pattern.Applying this pattern to your design lets you attach new behaviors to objects by placing these objects inside special wrapper objects that contain the behaviors. In addition, you can fix the code duplication issue in both classes.

I attach an idea of implementing the Decorator pattern.

image