You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What seems complicated is initialising concrete Superpowers with the necessary resources (playSound(), spawnParticles(), etc) in section "How does the base class get the state that it needs?".
I wonder if the Strategy pattern could be used instead of the new pattern? Let me explain briefly what I mean and perhaps you could elaborate on the similarities and/or differences of both approaches:
Say you have an interface Superpower -
Any new super power you would create then realises the interface. Following, the SuperpowerResources class is separately initialised, containing the necessary resources the super power implementations need -
What seems complicated is initialising concrete Superpowers with the necessary resources (playSound(), spawnParticles(), etc) in section "How does the base class get the state that it needs?".
I wonder if the Strategy pattern could be used instead of the new pattern? Let me explain briefly what I mean and perhaps you could elaborate on the similarities and/or differences of both approaches:
Say you have an interface Superpower -
Any new super power you would create then realises the interface. Following, the SuperpowerResources class is separately initialised, containing the necessary resources the super power implementations need -
The text was updated successfully, but these errors were encountered: