For an exercise I have an enum (set by the teacher) that looks like this :
enum class Weapon(name: String, damage: Int) {
SWORD("Sword", 12),
AXE("Axe", 13),
BOW("Bow", 14)
}
The weapon will be an attribute of a data class Player
But once I set player.weapon = Weapon.SWORD
How do i access to the name or damage of the weapon ?
I have looked on the Internet for an answer but didn't find anywhere an enum with two "parameter" (don't know how to call it) so I start wondering if this enum is possible.
Thanks guys