Skip to main content
added 9 characters in body
Source Link

If I was implementing something like this I would probably use inheritance. I would have a base class Power that contains all the methods you need and virtualabstract/virtual methods for applying the power. Each powerup could then be its own class that overrides the virtual apply power method and the rest of the powerup is managed by your base class.

If I was implementing something like this I would probably use inheritance. I would have a base class Power that contains all the methods you need and virtual methods for applying the power. Each powerup could then be its own class that overrides the virtual apply power method and the rest of the powerup is managed by your base class.

If I was implementing something like this I would probably use inheritance. I would have a base class Power that contains all the methods you need and abstract/virtual methods for applying the power. Each powerup could then be its own class that overrides the virtual apply power method and the rest of the powerup is managed by your base class.

Source Link

If I was implementing something like this I would probably use inheritance. I would have a base class Power that contains all the methods you need and virtual methods for applying the power. Each powerup could then be its own class that overrides the virtual apply power method and the rest of the powerup is managed by your base class.