Hello and welcome! Well, as far as my Pokémon knowledge goes, I suppose you need this to calculate super-effectiveness, right?
There are many approaches to this problem, and yours is as valid as any. You can also do what Game Freak does and use a hard-coded solution or even a DataAsset/DataTable solution.
In older Pokémon games, Game Freak manually checks the attack type against the target type(s). In a modern code, it would be something like this:
// Hard-coded example.
switch (Attack.Type)
{
case EType::Fire:
if (Target.Type.Contains(EType::Bug))
Damage *= 2
if (Target.Type.Contains(EType::Grass))
Damage *= 2
if (Target.Type.Contains(EType::Water))
Damage /= 2
if (Target.Type.Contains(EType::Fire))
Damage /= 2
if (etc.)
...
break
case EType::Water
...
}
PS.: Notice that the Pokémon type property is an array of Types Enum.
As you mentioned, you can also apply an edit-friendly solution, like a data table or data asset, where you list the super effective and resistance types multipliers.
Types Enumerator
Data Struct
Data Table
And of course, there are other approaches; it all depends on your project design; these are just the most straightforward methods.:
Also, Ryan Laley is doing a Pokémon like game series. Maybe it can help you.
Remaking Pokémon in Unreal Engine 5 LIVE - YouTube