How best to implement items and weapons in my RPG. Nested classes? Delegates?
Olivier Pisano
olivier.pisano at laposte.net
Thu Apr 4 07:15:58 UTC 2024
Hi,
You should have a look at the decorator design pattern, it
reduces the amount of classes to implement if you need to combine
different effects such as elemental damage to your weapons (e.g.
if you want flame arrows).
https://en.wikipedia.org/wiki/Decorator_pattern
https://refactoring.guru/design-patterns/decorator
More information about the Digitalmars-d-learn
mailing list