mercredi 12 octobre 2022

Which design pattern is best suited for an Upgrade/Buff system?

I am creating a game (C#/Unity) and am trying to implement an Upgrade/Buff system. This project is also a platform for me to learn and implement different design patterns. I want to the system to work as follows:

-The buff contains all needed operations within itself and can be allied/removed easily.

-The buff can be a simple stat increase, but also have more complex behaviour, like applying damage over time in an area of effect.

The design pattern that seems most useable to me right now is the Decorator pattern. Maybe also the visitor pattern.

Does anybody with experience with such a system have some thougths about this?

Thanks!

Aucun commentaire:

Enregistrer un commentaire