I am trying to compare 2 enums with the equals method, as the ‘’==‘’ would not work for me and I read online it was the wrong way to do it. So I’ve tried a few things.
First off the main snippet of the code, the error being thrown on the first line, where I try the equals method.
case BaseAbility.AbilityTypes.FLAME:
if (enemy.PlayerClass.CharacterType.Equals(BaseCharacterClass.CharacterTypes.LEAF)) {
Debug.Log("FLAME V LEAF SPECIAL MODIFIER");
modifierValue = (int)(GameInformation.Special * playerSpecialModifier);
} else if (enemy.PlayerClass.CharacterType.Equals(BaseCharacterClass.CharacterTypes.LEAF)) {
Debug.Log("FLAME V RIVER SPECIAL MODIFIER");
modifierValue = (-(int)(GameInformation.Special * playerSpecialModifier));
} else {
Debug.Log("MODIFER WAS NOT CALCULATED BECAUSE THERE WAS NO TYPE ADVANTAGE");
modifierValue = 0;
}
break;
So I created a separate class just for enumerations, to compare from that. In the same way though. I can post any other info if needed. Really would appreciate help with this thank you so much in advance.