1 #ifndef OPENMW_MECHANICS_LEVELLEDLIST_H 
    2 #define OPENMW_MECHANICS_LEVELLEDLIST_H 
    8 #include "../mwworld/ptr.hpp" 
    9 #include "../mwworld/esmstore.hpp" 
   10 #include "../mwworld/manualref.hpp" 
   11 #include "../mwworld/class.hpp" 
   13 #include "../mwbase/world.hpp" 
   14 #include "../mwbase/environment.hpp" 
   25         const std::vector<ESM::LevelledListBase::LevelItem>& items = levItem->
mList;
 
   35         std::vector<std::string> candidates;
 
   37         for (std::vector<ESM::LevelledListBase::LevelItem>::const_iterator it = items.begin(); it != items.end(); ++it)
 
   39             if (it->mLevel > highestLevel && it->mLevel <= playerLevel)
 
   40                 highestLevel = it->mLevel;
 
   48         std::pair<int, std::string> highest = std::make_pair(-1, 
"");
 
   49         for (std::vector<ESM::LevelledListBase::LevelItem>::const_iterator it = items.begin(); it != items.end(); ++it)
 
   51             if (playerLevel >= it->mLevel
 
   52                     && (allLevels || it->mLevel == highestLevel))
 
   54                 candidates.push_back(it->mId);
 
   55                 if (it->mLevel >= highest.first)
 
   56                     highest = std::make_pair(it->mLevel, it->mId);
 
   59         if (candidates.empty())
 
   66             std::cerr << 
"Warning: ignoring nonexistent item '" << item << 
"' in levelled list '" << levItem->
mId << 
"'" << std::endl;
 
virtual MWMechanics::CreatureStats & getCreatureStats(const Ptr &ptr) const 
Definition: class.cpp:63
World * getWorld() const 
Definition: environment.cpp:82
const Class & getClass() const 
Definition: ptr.hpp:40
const std::string & getTypeName() const 
Definition: ptr.cpp:9
unsigned char mChanceNone
Definition: loadlevlist.hpp:24
static const Environment & get()
Return instance of this class. 
Definition: environment.cpp:171
static std::string lowerCase(const std::string &in)
Returns lower case copy of input string. 
Definition: stringops.hpp:103
virtual const MWWorld::ESMStore & getStore() const =0
MWWorld::Ptr getPlayer()
Definition: actorutil.cpp:10
const Ptr & getPtr() const 
Definition: manualref.hpp:22
int getLevel() const 
Definition: creaturestats.cpp:95
Manually constructed live cell ref. 
Definition: manualref.hpp:11
static int rollDice(int max)
return value in range [0, max) <- note open upper range. 
Definition: rng.cpp:23
MWWorld::LiveCellRef< T > * get() const 
Definition: ptr.hpp:48
std::string getLevelledItem(const ESM::LevelledListBase *levItem, bool creature, unsigned char failChance=0)
Definition: levelledlist.hpp:23
Definition: loadlevlist.hpp:21
int find(const std::string &id) const 
Definition: esmstore.hpp:91
int mFlags
Definition: loadlevlist.hpp:23
Definition: loadlevlist.hpp:81
static int roll0to99()
return value in range [0, 99] 
Definition: rng.hpp:29
Definition: loadlevlist.hpp:46
std::vector< LevelItem > mList
Definition: loadlevlist.hpp:37
std::string mId
Definition: loadlevlist.hpp:25
Definition: loadlevlist.hpp:66
Pointer to a LiveCellRef. 
Definition: ptr.hpp:19
Definition: loadlevlist.hpp:55
const char * name
Definition: crashcatcher.cpp:59