Manages the aggro values for one AI
instance. There are several ways to degrade the aggro values.
More...
#include <AggroMgr.h>
|
typedef std::vector< Entry > | Entries |
|
typedef Entries::iterator | EntriesIter |
|
|
| AggroMgr (std::size_t expectedEntrySize=0u) |
|
void | setReduceByRatio (float reduceRatioSecond, float minAggro) |
|
void | setReduceByValue (float reduceValueSecond) |
|
void | resetReduceValue () |
|
void | update (int64_t deltaMillis) |
| this will update the aggro list according to the reduction type of an entry. More...
|
|
EntryPtr | addAggro (CharacterId id, float amount) |
| will increase the aggro More...
|
|
const Entries & | getEntries () const |
|
EntryPtr | getHighestEntry () const |
| Get the entry with the highest aggro value. More...
|
|
|
void | cleanupList () |
| Remove the entries from the list that have no aggro left. This list is ordered, so we will only remove the first X elements.
|
|
void | sort () const |
|
|
static bool | EntrySorter (const Entry &a, const Entry &b) |
|
|
Entries | _entries |
|
bool | _dirty |
|
float | _minAggro = 0.0f |
|
float | _reduceRatioSecond = 0.0f |
|
float | _reduceValueSecond = 0.0f |
|
ReductionType | _reduceType = DISABLED |
|
Manages the aggro values for one AI
instance. There are several ways to degrade the aggro values.
EntryPtr ai::AggroMgr::addAggro |
( |
CharacterId |
id, |
|
|
float |
amount |
|
) |
| |
|
inline |
will increase the aggro
- Parameters
-
[in] | id | The entity id to increase the aggro against |
[in] | amount | The amount to increase the aggro for |
- Returns
- The aggro
Entry
that was added or updated. Useful for changing the reduce type or amount.
const Entries& ai::AggroMgr::getEntries |
( |
| ) |
const |
|
inline |
- Returns
- All the aggro entries
EntryPtr ai::AggroMgr::getHighestEntry |
( |
| ) |
const |
|
inline |
Get the entry with the highest aggro value.
- Note
- Might execute a sort on the list if its dirty
void ai::AggroMgr::update |
( |
int64_t |
deltaMillis | ) |
|
|
inline |
this will update the aggro list according to the reduction type of an entry.
- Parameters
-
[in] | deltaMillis | The current milliseconds to use to update the aggro value of the entries. |
The documentation for this class was generated from the following file:
- /home/travis/build/mgerhardy/simpleai/src/ai/aggro/AggroMgr.h