Answer the question
In order to leave comments, you need to log in
How to modify c# decorator pattern so that it can be removed?
I am developing a game like HearthStone in c#. I'm trying to implement a buff system using the "decorator" pattern. There is a class Card
public abstract class Card
{
public string Name { get; set; }
public string Description { get; set; }
public int Health { get; set; }
public int Damage { get; set; }
public int Mana { get; set; }
}
public abstract class HealthBuff : Card
{
public string Name { get; set; }
public string Description { get; set; }
public int Health => base.Health + 2;
public int Damage { get; set; }
public int Mana { get; set; }
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question