Every Hero has 2 roles as string stored in GameObject->UnitComponentInfo->RoleString (I can help reversing the offset if needed).
Would be nice to have that, its usually smth like "Marksman, Figher" etc. Theres also some other need stuff in it to easily check object types.