mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-13 19:54:17 +02:00
attempt to fix the build
This commit is contained in:
@@ -1544,41 +1544,14 @@ DLL_LINKAGE ArtifactPosition ArtifactUtils::getArtifactDstPosition( const CArtif
|
|||||||
return ArtifactPosition(GameConstants::BACKPACK_START);
|
return ArtifactPosition(GameConstants::BACKPACK_START);
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace ArtifactUtils
|
DLL_LINKAGE bool ArtifactUtils::isArtRemovable(const std::pair<ArtifactPosition, ArtSlotInfo> & slot)
|
||||||
{
|
|
||||||
|
|
||||||
DLL_LINKAGE const std::array<ArtifactPosition::EArtifactPosition, 2> unmovableSlots =
|
|
||||||
{
|
|
||||||
ArtifactPosition::SPELLBOOK,
|
|
||||||
ArtifactPosition::MACH4
|
|
||||||
};
|
|
||||||
|
|
||||||
DLL_LINKAGE const std::array<ArtifactPosition::EArtifactPosition, 14> constituentWornSlots =
|
|
||||||
{
|
|
||||||
ArtifactPosition::HEAD,
|
|
||||||
ArtifactPosition::SHOULDERS,
|
|
||||||
ArtifactPosition::NECK,
|
|
||||||
ArtifactPosition::RIGHT_HAND,
|
|
||||||
ArtifactPosition::LEFT_HAND,
|
|
||||||
ArtifactPosition::TORSO,
|
|
||||||
ArtifactPosition::RIGHT_RING,
|
|
||||||
ArtifactPosition::LEFT_RING,
|
|
||||||
ArtifactPosition::FEET,
|
|
||||||
ArtifactPosition::MISC1,
|
|
||||||
ArtifactPosition::MISC2,
|
|
||||||
ArtifactPosition::MISC3,
|
|
||||||
ArtifactPosition::MISC4,
|
|
||||||
ArtifactPosition::MISC5,
|
|
||||||
};
|
|
||||||
|
|
||||||
DLL_LINKAGE bool isArtRemovable(const std::pair<ArtifactPosition, ArtSlotInfo> & slot)
|
|
||||||
{
|
{
|
||||||
return slot.second.artifact
|
return slot.second.artifact
|
||||||
&& !slot.second.locked
|
&& !slot.second.locked
|
||||||
&& !vstd::contains(unmovableSlots, slot.first);
|
&& !vstd::contains(unmovableSlots, slot.first);
|
||||||
}
|
}
|
||||||
|
|
||||||
DLL_LINKAGE bool checkSpellbookIsNeeded(const CGHeroInstance * heroPtr, ArtifactID artID, ArtifactPosition slot)
|
DLL_LINKAGE bool ArtifactUtils::checkSpellbookIsNeeded(const CGHeroInstance * heroPtr, ArtifactID artID, ArtifactPosition slot)
|
||||||
{
|
{
|
||||||
// TODO what'll happen if Titan's thunder is equipped by pickin git up or the start of game?
|
// TODO what'll happen if Titan's thunder is equipped by pickin git up or the start of game?
|
||||||
// Titan's Thunder creates new spellbook on equip
|
// Titan's Thunder creates new spellbook on equip
|
||||||
@@ -1593,10 +1566,9 @@ DLL_LINKAGE bool checkSpellbookIsNeeded(const CGHeroInstance * heroPtr, Artifact
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
DLL_LINKAGE bool isSlotBackpack(ArtifactPosition slot)
|
DLL_LINKAGE bool ArtifactUtils::isSlotBackpack(ArtifactPosition slot)
|
||||||
{
|
{
|
||||||
return slot >= GameConstants::BACKPACK_START;
|
return slot >= GameConstants::BACKPACK_START;
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
VCMI_LIB_NAMESPACE_END
|
VCMI_LIB_NAMESPACE_END
|
||||||
|
@@ -386,8 +386,28 @@ namespace ArtifactUtils
|
|||||||
DLL_LINKAGE ArtifactPosition getArtifactDstPosition( const CArtifactInstance * artifact,
|
DLL_LINKAGE ArtifactPosition getArtifactDstPosition( const CArtifactInstance * artifact,
|
||||||
const CArtifactSet * target,
|
const CArtifactSet * target,
|
||||||
ArtBearer::ArtBearer bearer);
|
ArtBearer::ArtBearer bearer);
|
||||||
DLL_LINKAGE extern const std::array<ArtifactPosition::EArtifactPosition, 2> unmovableSlots;
|
const std::array<ArtifactPosition::EArtifactPosition, 2> unmovableSlots =
|
||||||
DLL_LINKAGE extern const std::array<ArtifactPosition::EArtifactPosition, 14> constituentWornSlots;
|
{
|
||||||
|
ArtifactPosition::SPELLBOOK,
|
||||||
|
ArtifactPosition::MACH4
|
||||||
|
};
|
||||||
|
const std::array<ArtifactPosition::EArtifactPosition, 14> constituentWornSlots =
|
||||||
|
{
|
||||||
|
ArtifactPosition::HEAD,
|
||||||
|
ArtifactPosition::SHOULDERS,
|
||||||
|
ArtifactPosition::NECK,
|
||||||
|
ArtifactPosition::RIGHT_HAND,
|
||||||
|
ArtifactPosition::LEFT_HAND,
|
||||||
|
ArtifactPosition::TORSO,
|
||||||
|
ArtifactPosition::RIGHT_RING,
|
||||||
|
ArtifactPosition::LEFT_RING,
|
||||||
|
ArtifactPosition::FEET,
|
||||||
|
ArtifactPosition::MISC1,
|
||||||
|
ArtifactPosition::MISC2,
|
||||||
|
ArtifactPosition::MISC3,
|
||||||
|
ArtifactPosition::MISC4,
|
||||||
|
ArtifactPosition::MISC5,
|
||||||
|
};
|
||||||
DLL_LINKAGE bool isArtRemovable(const std::pair<ArtifactPosition, ArtSlotInfo> & slot);
|
DLL_LINKAGE bool isArtRemovable(const std::pair<ArtifactPosition, ArtSlotInfo> & slot);
|
||||||
DLL_LINKAGE bool checkSpellbookIsNeeded(const CGHeroInstance * heroPtr, ArtifactID artID, ArtifactPosition slot);
|
DLL_LINKAGE bool checkSpellbookIsNeeded(const CGHeroInstance * heroPtr, ArtifactID artID, ArtifactPosition slot);
|
||||||
DLL_LINKAGE bool isSlotBackpack(ArtifactPosition slot);
|
DLL_LINKAGE bool isSlotBackpack(ArtifactPosition slot);
|
||||||
|
@@ -15,19 +15,22 @@
|
|||||||
#include "../CCreatureSet.h"
|
#include "../CCreatureSet.h"
|
||||||
#include "../NetPacksBase.h"
|
#include "../NetPacksBase.h"
|
||||||
|
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
// Used in std::unordered_map
|
||||||
|
template<> struct hash<VCMI_LIB_WRAP_NAMESPACE(ArtifactID)>
|
||||||
|
{
|
||||||
|
size_t operator()(const VCMI_LIB_WRAP_NAMESPACE(ArtifactID) & aid) const
|
||||||
|
{
|
||||||
|
return hash<int>{}(aid.num);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
VCMI_LIB_NAMESPACE_BEGIN
|
VCMI_LIB_NAMESPACE_BEGIN
|
||||||
|
|
||||||
class CGCreature;
|
class CGCreature;
|
||||||
|
|
||||||
// Used in std::unordered_map
|
|
||||||
template<> struct std::hash<ArtifactID>
|
|
||||||
{
|
|
||||||
std::size_t operator()(const ArtifactID & aid) const
|
|
||||||
{
|
|
||||||
return std::hash<int>{}(aid.num);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
class DLL_LINKAGE CQuest final
|
class DLL_LINKAGE CQuest final
|
||||||
{
|
{
|
||||||
mutable std::unordered_map<ArtifactID, unsigned> artifactsRequirements; // artifact ID -> required count
|
mutable std::unordered_map<ArtifactID, unsigned> artifactsRequirements; // artifact ID -> required count
|
||||||
|
@@ -134,7 +134,7 @@ QString QuestWidget::commitChanges()
|
|||||||
return QString("N/A");
|
return QString("N/A");
|
||||||
case CQuest::Emission::MISSION_ART:
|
case CQuest::Emission::MISSION_ART:
|
||||||
seerhut.quest->m5arts.clear();
|
seerhut.quest->m5arts.clear();
|
||||||
seerhut.quest->m5arts.push_back(ui->targetId->currentIndex());
|
seerhut.quest->m5arts.push_back(ArtifactID(ui->targetId->currentIndex()));
|
||||||
//TODO: support multiple artifacts
|
//TODO: support multiple artifacts
|
||||||
return ui->targetId->currentText();
|
return ui->targetId->currentText();
|
||||||
case CQuest::Emission::MISSION_ARMY:
|
case CQuest::Emission::MISSION_ARMY:
|
||||||
|
Reference in New Issue
Block a user