diasurgical/DevilutionX

Prefer scoped enums where possible

Ouverte

#2 300 ouverte le 4 juil. 2021

 (4 commentaires) (1 réaction) (0 personne assignée)C++ (743 forks)batch import
help wanted

Métriques du dépôt

Stars
 (7 255 étoiles)
Métriques de merge PR
 (Merge moyen 2j 12h) (15 PRs mergées en 30 j)

Description

Many of the unscoped enums used in devilutionX can use enum class instead. This gives stronger type safety for things like Direction and allows unambiguous constructors/conversion functions in related classes (e.g. Displacement).

This does make it more difficult to cast back to an integral type so the usage of some enums (such as _item_indexes) will need to be evaluated to see if it's worth changing those from unscoped to scoped.

Guide contributeur