1
0

Pawn: Enabled entity effect broadcast, added typedef

Typedef'd std::map<cEntityEffect::eType, cEntityEffect> to tEffectMap
This commit is contained in:
archshift 2014-06-07 00:54:03 -07:00
parent a9a4c9c6b2
commit e98ffccd80
2 changed files with 6 additions and 4 deletions

View File

@ -2,6 +2,7 @@
#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
#include "Pawn.h"
#include "../World.h"
@ -20,7 +21,7 @@ cPawn::cPawn(eEntityType a_EntityType, double a_Width, double a_Height)
void cPawn::Tick(float a_Dt, cChunk & a_Chunk)
{
// Iterate through this entity's applied effects
for (std::map<cEntityEffect::eType, cEntityEffect>::iterator iter = m_EntityEffects.begin();
for (tEffectMap::iterator iter = m_EntityEffects.begin();
iter != m_EntityEffects.end();
++iter)
{
@ -49,7 +50,7 @@ void cPawn::Tick(float a_Dt, cChunk & a_Chunk)
void cPawn::AddEntityEffect(cEntityEffect::eType a_EffectType, cEntityEffect a_Effect)
{
m_EntityEffects[a_EffectType] = a_Effect;
//m_World->BroadcastEntityEffect(*this, a_EffectType, a_Effect.m_Intensity, a_Effect.m_Ticks);
m_World->BroadcastEntityEffect(*this, a_EffectType, a_Effect.GetIntensity(), a_Effect.m_Ticks);
}
@ -59,7 +60,7 @@ void cPawn::AddEntityEffect(cEntityEffect::eType a_EffectType, cEntityEffect a_E
void cPawn::RemoveEntityEffect(cEntityEffect::eType a_EffectType)
{
m_EntityEffects.erase(a_EffectType);
//m_World->BroadcastRemoveEntityEffect(*this, a_EffectType);
m_World->BroadcastRemoveEntityEffect(*this, a_EffectType);
}

View File

@ -26,7 +26,8 @@ public:
void RemoveEntityEffect(cEntityEffect::eType a_EffectType);
protected:
std::map<cEntityEffect::eType, cEntityEffect> m_EntityEffects;
typedef std::map<cEntityEffect::eType, cEntityEffect> tEffectMap;
tEffectMap m_EntityEffects;
virtual void HandleEntityEffects(cEntityEffect::eType a_EffectType, cEntityEffect a_Effect);
} ; // tolua_export