diasurgical/DevilutionX

Prefer scoped enums where possible

オープン

#2,300 opened on 2021/07/04

 (4 件のコメント) (1 件のリアクション) (0 人の担当者)C++ (743 件のフォーク)batch import
help wanted

Repository metrics

Stars
 (7,255 個のスター)
PR merge metrics
 (平均マージ 2d 12h) (30d で 15 merged PRs)

説明

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.

コントリビューターガイド