1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Explicitly convert identifier to underlying enumeration

This commit is contained in:
Ivan Savenko
2023-11-02 16:29:59 +02:00
parent 87f6c7354b
commit 2b9c362d5b
17 changed files with 30 additions and 30 deletions

View File

@@ -273,7 +273,7 @@ void CGResource::initObj(CRandomGenerator & rand)
if(amount == CGResource::RANDOM_AMOUNT)
{
switch(resourceID())
switch(resourceID().toEnum())
{
case EGameResID::GOLD:
amount = rand.nextInt(5, 10) * 100;
@@ -532,7 +532,7 @@ void CGMonolith::initObj(CRandomGenerator & rand)
{
std::vector<Obj> IDs;
IDs.push_back(ID);
switch(ID)
switch(ID.toEnum())
{
case Obj::MONOLITH_ONE_WAY_ENTRANCE:
type = ENTRANCE;
@@ -723,7 +723,7 @@ ArtifactID CGArtifact::getArtifact() const
void CGArtifact::pickRandomObject(CRandomGenerator & rand)
{
switch(ID)
switch(ID.toEnum())
{
case MapObjectID::RANDOM_ART:
subID = VLC->arth->pickRandomArtifact(rand, CArtifact::ART_TREASURE | CArtifact::ART_MINOR | CArtifact::ART_MAJOR | CArtifact::ART_RELIC);
@@ -786,7 +786,7 @@ void CGArtifact::onHeroVisit(const CGHeroInstance * h) const
if(storedArtifact->artType->canBePutAt(h))
{
switch (ID)
switch (ID.toEnum())
{
case Obj::ARTIFACT:
{
@@ -821,7 +821,7 @@ void CGArtifact::onHeroVisit(const CGHeroInstance * h) const
}
else
{
switch(ID)
switch(ID.toEnum())
{
case Obj::ARTIFACT:
{