I am currently working on developing a dungeon-crawler-esque game in c# but am currently having trouble with the constructors of a class. I was wondering if it is possible to have different constructors depending on the initial enum value? In this case, it only has two possible values so a simple boolean would suffice but if I was to have more than two, I was curious if you could execute different constructors depending on the initial enum value entered? Sorry if my formatting is wrong or if I'm not very specific, this is my first time submitting a question on here :)).
For reference here are my current enums here:
public enum Type
{
Passive,
Action
}
public enum Trigger
{
PlayerTakeDamage,
EnemyTakeDamage,
Draw,
PlayerDebuff,
EnemyDebuff,
PlayCard
}
Here is along the lines of what I want to accomplish:
public class Action
{
public int Energy {get; private set;}
public int Damage {get; private set;}
public Action(Type.Passive, Trigger trigger, int damage, int energy)
{
do thing;
}
public Action(Type.Action, int damage, int energy)
{
do other thing;
}
}
Again, I apologize if this is a dumb question or if I messed up the formatting on here, but I would sincerely appreciate any advice or recommendations that anyone could offer :))!
Edit: I'm sorry I wasn't very specific about the potential applications. I want to overload the constructors based on the intial enum value because I want to have completed different additional parameters after that would be required upon construction. I've added clarification to help :)).