diasurgical/DevilutionX

Prefer scoped enums where possible

开放

#2,300 创建于 2021年7月4日

 (4 条评论) (1 个反应) (0 位负责人)C++ (743 个派生)batch import
help wanted

仓库指标

星标
 (7,255 个星标)
PR 合并指标
 (平均合并 2天 12小时) (30 天内合并 15 个 PR)

描述

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.

贡献者指南