♻️ Convert 'ItemType' enum to enum class

🎨 Rename 'ItemType' elements to enum class standards
This commit is contained in:
Juliano Leal Goncalves 2021-09-06 22:48:01 -03:00 committed by Anders Jenbo
commit 379a27b64a
23 changed files with 703 additions and 703 deletions

View file

@ -429,19 +429,19 @@ int DrawDurIcon4Item(const Surface &out, Item &pItem, int x, int c)
return x;
if (c == 0) {
switch (pItem._itype) {
case ITYPE_SWORD:
case ItemType::Sword:
c = 2;
break;
case ITYPE_AXE:
case ItemType::Axe:
c = 6;
break;
case ITYPE_BOW:
case ItemType::Bow:
c = 7;
break;
case ITYPE_MACE:
case ItemType::Mace:
c = 5;
break;
case ITYPE_STAFF:
case ItemType::Staff:
c = 8;
break;
default:
@ -1314,7 +1314,7 @@ void DrawInfoBox(const Surface &out)
InfoColor = UiFlags::ColorSilver;
} else if (pcurs >= CURSOR_FIRSTITEM) {
auto &myPlayer = Players[MyPlayerId];
if (myPlayer.HoldItem._itype == ITYPE_GOLD) {
if (myPlayer.HoldItem._itype == ItemType::Gold) {
int nGold = myPlayer.HoldItem._ivalue;
strcpy(infostr, fmt::format(ngettext("{:d} gold piece", "{:d} gold pieces", nGold), nGold).c_str());
} else if (!myPlayer.HoldItem._iStatFlag) {