mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
Optimized getHeroStrength method
- replaced 4x access to bonus system with single access - fixed formula for Diplomacy - fxied formula for hero transfer in campaigns - removed pointless sqrt(pow()) construct
This commit is contained in:
@@ -97,8 +97,6 @@ const PrimarySkill PrimarySkill::ATTACK(0);
|
||||
const PrimarySkill PrimarySkill::DEFENSE(1);
|
||||
const PrimarySkill PrimarySkill::SPELL_POWER(2);
|
||||
const PrimarySkill PrimarySkill::KNOWLEDGE(3);
|
||||
const PrimarySkill PrimarySkill::BEGIN(0);
|
||||
const PrimarySkill PrimarySkill::END(4);
|
||||
const PrimarySkill PrimarySkill::EXPERIENCE(4);
|
||||
|
||||
const BoatId BoatId::NONE(-1);
|
||||
@@ -630,6 +628,18 @@ std::string GameResID::entityType()
|
||||
return "resource";
|
||||
}
|
||||
|
||||
const std::array<PrimarySkill, 4> & PrimarySkill::ALL_SKILLS()
|
||||
{
|
||||
static const std::array allSkills = {
|
||||
PrimarySkill(ATTACK),
|
||||
PrimarySkill(DEFENSE),
|
||||
PrimarySkill(SPELL_POWER),
|
||||
PrimarySkill(KNOWLEDGE)
|
||||
};
|
||||
|
||||
return allSkills;
|
||||
}
|
||||
|
||||
const std::array<GameResID, 7> & GameResID::ALL_RESOURCES()
|
||||
{
|
||||
static const std::array allResources = {
|
||||
|
||||
Reference in New Issue
Block a user