1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-29 09:15:33 +00:00

Get rid of Boost.Array

This commit is contained in:
Capostrophic 2019-02-22 21:40:21 +03:00
parent ba491a8af0
commit 58788de7c4
5 changed files with 6 additions and 11 deletions

View file

@ -554,7 +554,7 @@ namespace MWGui
{ {
if (mGenerateClassStep == 10) if (mGenerateClassStep == 10)
{ {
static boost::array<ClassPoint, 23> classes = { { static std::array<ClassPoint, 23> classes = { {
{"Acrobat", {6, 2, 2}}, {"Acrobat", {6, 2, 2}},
{"Agent", {6, 1, 3}}, {"Agent", {6, 1, 3}},
{"Archer", {3, 5, 2}}, {"Archer", {3, 5, 2}},

View file

@ -228,11 +228,9 @@ namespace MWGui
std::set<int> skillSet; std::set<int> skillSet;
std::copy(major.begin(), major.end(), std::inserter(skillSet, skillSet.begin())); std::copy(major.begin(), major.end(), std::inserter(skillSet, skillSet.begin()));
std::copy(minor.begin(), minor.end(), std::inserter(skillSet, skillSet.begin())); std::copy(minor.begin(), minor.end(), std::inserter(skillSet, skillSet.begin()));
boost::array<ESM::Skill::SkillEnum, ESM::Skill::Length>::const_iterator end = ESM::Skill::sSkillIds.end();
mMiscSkills.clear(); mMiscSkills.clear();
for (boost::array<ESM::Skill::SkillEnum, ESM::Skill::Length>::const_iterator it = ESM::Skill::sSkillIds.begin(); it != end; ++it) for (const int skill : ESM::Skill::sSkillIds)
{ {
int skill = *it;
if (skillSet.find(skill) == skillSet.end()) if (skillSet.find(skill) == skillSet.end())
mMiscSkills.push_back(skill); mMiscSkills.push_back(skill);
} }

View file

@ -278,11 +278,9 @@ namespace MWGui
std::set<int> skillSet; std::set<int> skillSet;
std::copy(major.begin(), major.end(), std::inserter(skillSet, skillSet.begin())); std::copy(major.begin(), major.end(), std::inserter(skillSet, skillSet.begin()));
std::copy(minor.begin(), minor.end(), std::inserter(skillSet, skillSet.begin())); std::copy(minor.begin(), minor.end(), std::inserter(skillSet, skillSet.begin()));
boost::array<ESM::Skill::SkillEnum, ESM::Skill::Length>::const_iterator end = ESM::Skill::sSkillIds.end();
mMiscSkills.clear(); mMiscSkills.clear();
for (boost::array<ESM::Skill::SkillEnum, ESM::Skill::Length>::const_iterator it = ESM::Skill::sSkillIds.begin(); it != end; ++it) for (const int skill : ESM::Skill::sSkillIds)
{ {
int skill = *it;
if (skillSet.find(skill) == skillSet.end()) if (skillSet.find(skill) == skillSet.end())
mMiscSkills.push_back(skill); mMiscSkills.push_back(skill);
} }

View file

@ -97,7 +97,7 @@ namespace ESM
"stealth_speechcraft.dds", "stealth_speechcraft.dds",
"stealth_handtohand.dds", "stealth_handtohand.dds",
}; };
const boost::array<Skill::SkillEnum, Skill::Length> Skill::sSkillIds = {{ const std::array<Skill::SkillEnum, Skill::Length> Skill::sSkillIds = {{
Block, Block,
Armorer, Armorer,
MediumArmor, MediumArmor,

View file

@ -1,10 +1,9 @@
#ifndef OPENMW_ESM_SKIL_H #ifndef OPENMW_ESM_SKIL_H
#define OPENMW_ESM_SKIL_H #define OPENMW_ESM_SKIL_H
#include <array>
#include <string> #include <string>
#include <boost/array.hpp>
#include "defs.hpp" #include "defs.hpp"
namespace ESM { namespace ESM {
@ -76,7 +75,7 @@ struct Skill
static const std::string sSkillNames[Length]; static const std::string sSkillNames[Length];
static const std::string sSkillNameIds[Length]; static const std::string sSkillNameIds[Length];
static const std::string sIconNames[Length]; static const std::string sIconNames[Length];
static const boost::array<SkillEnum, Length> sSkillIds; static const std::array<SkillEnum, Length> sSkillIds;
void load(ESMReader &esm, bool &isDeleted); void load(ESMReader &esm, bool &isDeleted);
void save(ESMWriter &esm, bool isDeleted = false) const; void save(ESMWriter &esm, bool isDeleted = false) const;