mirror of
https://github.com/vcmi/vcmi.git
synced 2025-02-03 13:01:33 +02:00
- gcc compile fixes
This commit is contained in:
parent
55e7959fd9
commit
706510f12f
@ -1139,15 +1139,19 @@ void CCreaInfo::clickRight(tribool down, bool previousState)
|
||||
boost::shared_ptr<BonusList> bl;
|
||||
const CGHeroInstance *hero = town->garrisonHero;
|
||||
if (hero)
|
||||
{
|
||||
bl = hero->getAllBonuses(Selector::type(Bonus::CREATURE_GROWTH) && Selector::subtype(level)
|
||||
&& Selector::sourceType(Bonus::ARTIFACT), 0, hero);
|
||||
|
||||
}
|
||||
hero = town->visitingHero;
|
||||
if (hero)
|
||||
{
|
||||
boost::shared_ptr<BonusList> blAppend = hero->getAllBonuses(Selector::type(Bonus::CREATURE_GROWTH) && Selector::subtype(level)
|
||||
&& Selector::sourceType(Bonus::ARTIFACT), 0, hero);
|
||||
bl->insert(bl->size(), blAppend->begin(), blAppend->end()) ;
|
||||
if (town->garrisonHero)
|
||||
bl->insert(bl->size(), blAppend->begin(), blAppend->end());
|
||||
else
|
||||
bl = blAppend;
|
||||
}
|
||||
|
||||
if (bl->size())
|
||||
|
@ -191,7 +191,7 @@ void BonusList::push_back(Bonus* const &x)
|
||||
CBonusSystemNode::incrementTreeChangedNum();
|
||||
}
|
||||
|
||||
std::vector<Bonus*>::iterator BonusList::erase(std::vector<Bonus*>::const_iterator position)
|
||||
std::vector<Bonus*>::iterator BonusList::erase(std::vector<Bonus*>::iterator position)
|
||||
{
|
||||
if (belongsToTree)
|
||||
CBonusSystemNode::incrementTreeChangedNum();
|
||||
|
@ -337,18 +337,18 @@ public:
|
||||
// wrapper functions of the STL vector container
|
||||
std::vector<Bonus*>::size_type size() const { return bonuses.size(); }
|
||||
void push_back(Bonus* const &x);
|
||||
std::vector<Bonus*>::iterator erase (std::vector<Bonus*>::const_iterator position);
|
||||
std::vector<Bonus*>::iterator erase (std::vector<Bonus*>::iterator position);
|
||||
void clear();
|
||||
void resize(std::vector<Bonus*>::size_type sz, Bonus* c = NULL );
|
||||
void insert(std::vector<Bonus*>::iterator position, std::vector<Bonus*>::size_type n, Bonus* const &x);
|
||||
(Bonus *const) &operator[] (std::vector<Bonus*>::size_type n) { return bonuses[n]; }
|
||||
(Bonus *const) &operator[] (std::vector<Bonus*>::size_type n) const { return bonuses[n]; }
|
||||
(Bonus *const) &back() { return bonuses.back(); }
|
||||
(Bonus *const) &front() { return bonuses.front(); }
|
||||
(Bonus *const) &back() const { return bonuses.back(); }
|
||||
(Bonus *const) &front() const { return bonuses.front(); }
|
||||
std::vector<Bonus*>::const_iterator begin() { return bonuses.begin(); }
|
||||
std::vector<Bonus*>::const_iterator end() { return bonuses.end(); }
|
||||
Bonus *const &operator[] (std::vector<Bonus*>::size_type n) { return bonuses[n]; }
|
||||
Bonus *const &operator[] (std::vector<Bonus*>::size_type n) const { return bonuses[n]; }
|
||||
Bonus *const &back() { return bonuses.back(); }
|
||||
Bonus *const &front() { return bonuses.front(); }
|
||||
Bonus *const &back() const { return bonuses.back(); }
|
||||
Bonus *const &front() const { return bonuses.front(); }
|
||||
std::vector<Bonus*>::iterator begin() { return bonuses.begin(); }
|
||||
std::vector<Bonus*>::iterator end() { return bonuses.end(); }
|
||||
std::vector<Bonus*>::const_iterator begin() const { return bonuses.begin(); }
|
||||
std::vector<Bonus*>::const_iterator end() const { return bonuses.end(); }
|
||||
std::vector<Bonus*>::size_type operator-=(Bonus* const &i);
|
||||
@ -385,13 +385,7 @@ public:
|
||||
}
|
||||
|
||||
template <class InputIterator>
|
||||
void insert(const int position, InputIterator first, InputIterator last)
|
||||
{
|
||||
bonuses.insert(bonuses.begin() + position, first, last);
|
||||
|
||||
if (belongsToTree)
|
||||
CBonusSystemNode::incrementTreeChangedNum();
|
||||
}
|
||||
void insert(const int position, InputIterator first, InputIterator last);
|
||||
|
||||
template <typename Handler> void serialize(Handler &h, const int version)
|
||||
{
|
||||
@ -830,6 +824,15 @@ namespace Selector
|
||||
|
||||
extern DLL_EXPORT const std::map<std::string, int> bonusNameMap;
|
||||
|
||||
// BonusList template that requires full interface of CBonusSystemNode
|
||||
template <class InputIterator>
|
||||
void BonusList::insert(const int position, InputIterator first, InputIterator last)
|
||||
{
|
||||
bonuses.insert(bonuses.begin() + position, first, last);
|
||||
|
||||
if (belongsToTree)
|
||||
CBonusSystemNode::incrementTreeChangedNum();
|
||||
}
|
||||
|
||||
// Extensions for BOOST_FOREACH to enable iterating of BonusList objects
|
||||
namespace boost
|
||||
@ -841,7 +844,7 @@ namespace boost
|
||||
};
|
||||
|
||||
template<>
|
||||
struct range_const_iterator<::BonusList>
|
||||
struct range_const_iterator<BonusList>
|
||||
{
|
||||
typedef std::vector<Bonus*>::const_iterator type;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user