summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Entities/EntityEffect.cpp35
-rw-r--r--src/Entities/EntityEffect.h14
2 files changed, 29 insertions, 20 deletions
diff --git a/src/Entities/EntityEffect.cpp b/src/Entities/EntityEffect.cpp
index be501297c..852099b79 100644
--- a/src/Entities/EntityEffect.cpp
+++ b/src/Entities/EntityEffect.cpp
@@ -33,7 +33,11 @@ cEntityEffect::cEntityEffect(int a_Duration, short a_Intensity, double a_Distanc
-cEntityEffect::~cEntityEffect()
+cEntityEffect::cEntityEffect(const cEntityEffect & a_OtherEffect):
+ m_Ticks(a_OtherEffect.m_Ticks),
+ m_Duration(a_OtherEffect.m_Duration),
+ m_Intensity(a_OtherEffect.m_Intensity),
+ m_DistanceModifier(a_OtherEffect.m_DistanceModifier)
{
}
@@ -42,6 +46,19 @@ cEntityEffect::~cEntityEffect()
+cEntityEffect & cEntityEffect::operator=(cEntityEffect a_OtherEffect)
+{
+ std::swap(m_Ticks, a_OtherEffect.m_Ticks);
+ std::swap(m_Duration, a_OtherEffect.m_Duration);
+ std::swap(m_Intensity, a_OtherEffect.m_Intensity);
+ std::swap(m_DistanceModifier, a_OtherEffect.m_DistanceModifier);
+ return *this;
+}
+
+
+
+
+
cEntityEffect * cEntityEffect::CreateEntityEffect(cEntityEffect::eType a_EffectType, int a_Duration, short a_Intensity, double a_DistanceModifier)
{
switch (a_EffectType)
@@ -90,22 +107,6 @@ void cEntityEffect::OnTick(cPawn & a_Target)
-void cEntityEffect::OnActivate(cPawn & a_Target)
-{
-}
-
-
-
-
-
-void cEntityEffect::OnDeactivate(cPawn & a_Target)
-{
-}
-
-
-
-
-
/////////////////////////////////////////////////////////////////////////
// Instant Health
/////////////////////////////////////////////////////////////////////////
diff --git a/src/Entities/EntityEffect.h b/src/Entities/EntityEffect.h
index 6e53d83b8..c6532a9bd 100644
--- a/src/Entities/EntityEffect.h
+++ b/src/Entities/EntityEffect.h
@@ -45,7 +45,15 @@ public:
@param a_DistanceModifier The distance modifier for affecting potency, defaults to 1 */
cEntityEffect(int a_Duration, short a_Intensity, double a_DistanceModifier = 1);
- virtual ~cEntityEffect(void);
+ /** Creates an entity effect by copying another
+ @param a_OtherEffect The other effect to copy */
+ cEntityEffect(const cEntityEffect & a_OtherEffect);
+
+ /** Creates an entity effect by copying another
+ @param a_OtherEffect The other effect to copy */
+ cEntityEffect & operator=(cEntityEffect a_OtherEffect);
+
+ virtual ~cEntityEffect(void) {};
/** Creates a pointer to the proper entity effect from the effect type
@warning This function creates raw pointers that must be manually managed.
@@ -70,8 +78,8 @@ public:
void SetDistanceModifier(double a_DistanceModifier) { m_DistanceModifier = a_DistanceModifier; }
virtual void OnTick(cPawn & a_Target);
- virtual void OnActivate(cPawn & a_Target);
- virtual void OnDeactivate(cPawn & a_Target);
+ virtual void OnActivate(cPawn & a_Target) { }
+ virtual void OnDeactivate(cPawn & a_Target) { }
protected:
/** How many ticks this effect has been active for */