FastEcslent::Weapon Class Reference

#include <unitWeapons.h>

Inheritance diagram for FastEcslent::Weapon:

FastEcslent::UnitAspect FastEcslent::UnitAspect FastEcslent::UnitAspect FastEcslent::UnitAspect FastEcslent::UnitAspect FastEcslent::Aspect FastEcslent::Aspect FastEcslent::Aspect FastEcslent::Aspect FastEcslent::Aspect FastEcslent::Aspect FastEcslent::Aspect FastEcslent::Aspect FastEcslent::Aspect FastEcslent::Aspect FastEcslent::Aspect FastEcslent::Aspect FastEcslent::Aspect FastEcslent::Aspect FastEcslent::Aspect FastEcslent::Aspect FastEcslent::Aspect FastEcslent::Aspect FastEcslent::Aspect FastEcslent::Aspect FastEcslent::Aspect FastEcslent::Aspect FastEcslent::Aspect FastEcslent::Aspect FastEcslent::Aspect

List of all members.

Public Member Functions

 Weapon (Entity *ent, UnitAspectType ast, const WeaponType *wType)
 Weapon (Entity *ent, UnitAspectType ast)
void dealDamageToTarget (Target tgt, double dt)
void dealEnemySplashDamageToTarget (Target tgt, double dt, double radius)
void dealLineSplashDamageToTarget (Target tgt, double dt, double length, double width)
void setTarget ()
Target getTarget ()
void takeDamage (double amt)
void takeDamage (double amt, double dt)
virtual void tick (double dt)
virtual void init ()
double isBeingAttacked ()
void resetBeingAttack ()
 Weapon (Entity *ent, UnitAspectType ast, WeaponType wType)
void dealDamageToTarget (Target tgt, double dt)
void setTarget ()
Target getTarget ()
void takeDamage (double amt, double dt)
virtual void tick (double dt)
virtual void init ()
 Weapon (Entity *ent, UnitAspectType ast, WeaponType wType)
void dealDamageToTarget (Target tgt, double dt)
void setTarget ()
Target getTarget ()
void takeDamage (double amt, double dt)
virtual void tick (double dt)
virtual void init ()
 Weapon (Entity *ent, UnitAspectType ast, const WeaponType *wType)
 Weapon (Entity *ent, UnitAspectType ast)
void dealDamageToTarget (Target tgt, double dt)
void dealEnemySplashDamageToTarget (Target tgt, double dt, double radius)
void dealLineSplashDamageToTarget (Target tgt, double dt, double length, double width)
void setTarget ()
Target getTarget ()
void takeDamage (double amt)
void takeDamage (double amt, double dt)
virtual void tick (double dt)
virtual void init ()
double isBeingAttacked ()
void resetBeingAttack ()
 Weapon (Entity *ent, UnitAspectType ast, WeaponType wType)
void dealDamageToTarget (Target tgt, double dt)
void setTarget ()
Target getTarget ()
void takeDamage (double amt, double dt)
virtual void tick (double dt)
virtual void init ()

Public Attributes

const WeaponTypeweaponType
double damageMultiplier
double armor
DistanceMgrdistanceMgr
WeaponMgrweaponMgr
WeaponType weaponType
double damageDone
double hitpoints
DistanceMgrdistanceMgr
WeaponMgrweaponMgr
DistanceMgrdistanceMgr
WeaponMgrweaponMgr
const WeaponTypeweaponType
DistanceMgrdistanceMgr
WeaponMgrweaponMgr
DistanceMgrdistanceMgr
WeaponMgrweaponMgr

Private Member Functions

std::vector< Entity * > getUnitsInRadius (Entity *ent, double radius, bool enemy)
std::vector
< FastEcslent::Entity * > 
getUnitsInRectangle (Entity *src, Entity *tgt, double length, double width, bool enemy)
bool isPointInRectangle (Ogre::Vector3 sp1, Ogre::Vector3 sp2, Ogre::Vector3 sp3, Ogre::Vector3 sp4, Ogre::Vector3 point)
double getAreaTriangle (Ogre::Vector3 tp1, Ogre::Vector3 tp2, Ogre::Vector3 tp3)
std::vector< Entity * > getUnitsInRadius (Entity *ent, double radius, bool enemy)
std::vector
< FastEcslent::Entity * > 
getUnitsInRectangle (Entity *src, Entity *tgt, double length, double width, bool enemy)
bool isPointInRectangle (Ogre::Vector3 sp1, Ogre::Vector3 sp2, Ogre::Vector3 sp3, Ogre::Vector3 sp4, Ogre::Vector3 point)
double getAreaTriangle (Ogre::Vector3 tp1, Ogre::Vector3 tp2, Ogre::Vector3 tp3)

Private Attributes

Target target
int STANDSTILL
int BEINGATTACKED
double m_cooldown
double m_beingAttacked
double m_onfire


Detailed Description

Definition at line 24 of file unitWeapons.h.


Constructor & Destructor Documentation

FastEcslent::Weapon::Weapon ( Entity ent,
UnitAspectType  ast,
const WeaponType wType 
)

Definition at line 15 of file unitWeapons.cpp.

References init(), and weaponType.

FastEcslent::Weapon::Weapon ( Entity ent,
UnitAspectType  ast 
)

Definition at line 20 of file unitWeapons.cpp.

References init().

FastEcslent::Weapon::Weapon ( Entity ent,
UnitAspectType  ast,
WeaponType  wType 
)

Definition at line 13 of file unitWeapons.cpp.

References weaponType.

FastEcslent::Weapon::Weapon ( Entity ent,
UnitAspectType  ast,
WeaponType  wType 
)

FastEcslent::Weapon::Weapon ( Entity ent,
UnitAspectType  ast,
const WeaponType wType 
)

FastEcslent::Weapon::Weapon ( Entity ent,
UnitAspectType  ast 
)

FastEcslent::Weapon::Weapon ( Entity ent,
UnitAspectType  ast,
WeaponType  wType 
)


Member Function Documentation

std::vector< FastEcslent::Entity * > FastEcslent::Weapon::getUnitsInRadius ( Entity ent,
double  radius,
bool  enemy 
) [private]

Definition at line 128 of file unitWeapons.cpp.

References FastEcslent::ALIVE, FastEcslent::Entity::engine, FastEcslent::UnitAspect::entity, FastEcslent::Engine::entityMgr, FastEcslent::EntityMgr::ents, FastEcslent::EntityMgr::nEnts, and FastEcslent::Entity::pos.

Referenced by dealEnemySplashDamageToTarget().

std::vector< FastEcslent::Entity * > FastEcslent::Weapon::getUnitsInRectangle ( Entity src,
Entity tgt,
double  length,
double  width,
bool  enemyOnly 
) [private]

Get entities in Rectangle.

Definition at line 150 of file unitWeapons.cpp.

References FastEcslent::ALIVE, FastEcslent::Entity::engine, FastEcslent::UnitAspect::entity, FastEcslent::Engine::entityMgr, FastEcslent::EntityMgr::nEnts, and FastEcslent::Entity::pos.

Referenced by dealLineSplashDamageToTarget().

bool FastEcslent::Weapon::isPointInRectangle ( Ogre::Vector3  sp1,
Ogre::Vector3  sp2,
Ogre::Vector3  sp3,
Ogre::Vector3  sp4,
Ogre::Vector3  point 
) [private]

We only consider x & z

Definition at line 188 of file unitWeapons.cpp.

References getAreaTriangle().

double FastEcslent::Weapon::getAreaTriangle ( Ogre::Vector3  tp1,
Ogre::Vector3  tp2,
Ogre::Vector3  tp3 
) [private]

Using Heron's formula to calculate area of the triangle.

Definition at line 205 of file unitWeapons.cpp.

Referenced by isPointInRectangle().

void FastEcslent::Weapon::dealDamageToTarget ( Target  tgt,
double  dt 
)

Definition at line 71 of file unitWeapons.cpp.

References FastEcslent::WeaponType::damageAmount(), FastEcslent::WeaponType::damageCooldown(), FastEcslent::Target::entity, m_cooldown, m_onfire, STANDSTILL, takeDamage(), FastEcslent::Entity::weapon, and weaponType.

Referenced by tick().

void FastEcslent::Weapon::dealEnemySplashDamageToTarget ( Target  tgt,
double  dt,
double  radius 
)

deal circle shapedsplash damage in front of the unit, like Hellion in StarCraft 2

Definition at line 79 of file unitWeapons.cpp.

References FastEcslent::WeaponType::damageAmount(), DEBUG, FastEcslent::Target::entity, getUnitsInRadius(), m_cooldown, m_onfire, STANDSTILL, and weaponType.

Referenced by tick().

void FastEcslent::Weapon::dealLineSplashDamageToTarget ( Target  tgt,
double  dt,
double  length,
double  width 
)

deal line shaped splash damage in front of the unit, like Hellion in StarCraft 2

Definition at line 94 of file unitWeapons.cpp.

References FastEcslent::WeaponType::damageAmount(), DEBUG, FastEcslent::Target::entity, getUnitsInRectangle(), m_cooldown, m_onfire, STANDSTILL, and weaponType.

Referenced by tick().

void FastEcslent::Weapon::setTarget (  ) 

Target FastEcslent::Weapon::getTarget (  ) 

void FastEcslent::Weapon::takeDamage ( double  amt  ) 

Definition at line 108 of file unitWeapons.cpp.

References FastEcslent::ALIVE, armor, BEINGATTACKED, FastEcslent::DYING, FastEcslent::UnitAspect::entity, FastEcslent::Entity::hitpoints, m_beingAttacked, and FastEcslent::Entity::switchState().

Referenced by dealDamageToTarget().

void FastEcslent::Weapon::takeDamage ( double  amt,
double  dt 
)

Definition at line 118 of file unitWeapons.cpp.

References FastEcslent::ALIVE, armor, FastEcslent::DYING, FastEcslent::UnitAspect::entity, FastEcslent::Entity::hitpoints, and FastEcslent::Entity::switchState().

void FastEcslent::Weapon::tick ( double  dt  )  [virtual]

Reimplemented from FastEcslent::UnitAspect.

Definition at line 41 of file unitWeapons.cpp.

References FastEcslent::ALIVE, FastEcslent::DistanceMgr::closestEnemy, dealDamageToTarget(), dealEnemySplashDamageToTarget(), dealLineSplashDamageToTarget(), distanceMgr, FastEcslent::ExplosionTypes::Enemy_Line_Splash, FastEcslent::ExplosionTypes::Enemy_Splash, FastEcslent::Entity::engine, FastEcslent::Target::entity, FastEcslent::UnitAspect::entity, FastEcslent::Entity::entityId, FastEcslent::Engine::entityMgr, FastEcslent::Entity::entityState, FastEcslent::EntityMgr::ents, FastEcslent::Identity::id, FastEcslent::WeaponType::innerSplashRadius(), m_beingAttacked, m_cooldown, m_onfire, FastEcslent::Entity::speed, target, and weaponType.

void FastEcslent::Weapon::init ( void   )  [virtual]

Reimplemented from FastEcslent::UnitAspect.

Definition at line 24 of file unitWeapons.cpp.

References armor, BEINGATTACKED, damageMultiplier, FastEcslent::Engine::distanceMgr, distanceMgr, FastEcslent::Entity::engine, FastEcslent::UnitAspect::entity, FastEcslent::Entity::entityType, FastEcslent::Entity::hitpoints, FastEcslent::WeaponMgr::initArmor, FastEcslent::WeaponMgr::initDamageMultiplier, m_beingAttacked, m_cooldown, m_onfire, FastEcslent::WeaponMgr::maxHitpoints, STANDSTILL, FastEcslent::Engine::weaponMgr, weaponMgr, FastEcslent::WeaponMgr::weaponType, and weaponType.

Referenced by Weapon().

double FastEcslent::Weapon::isBeingAttacked (  )  [inline]

Definition at line 73 of file unitWeapons.h.

References m_beingAttacked.

Referenced by OgreGFX::GraphicsInteractionManager::copySimState().

void FastEcslent::Weapon::resetBeingAttack (  )  [inline]

Definition at line 74 of file unitWeapons.h.

References m_beingAttacked.

Referenced by OgreGFX::GraphicsInteractionManager::copySimState().

void FastEcslent::Weapon::dealDamageToTarget ( Target  tgt,
double  dt 
)

void FastEcslent::Weapon::setTarget (  ) 

Target FastEcslent::Weapon::getTarget (  ) 

void FastEcslent::Weapon::takeDamage ( double  amt,
double  dt 
)

virtual void FastEcslent::Weapon::tick ( double  dt  )  [virtual]

Reimplemented from FastEcslent::UnitAspect.

virtual void FastEcslent::Weapon::init (  )  [virtual]

Reimplemented from FastEcslent::UnitAspect.

void FastEcslent::Weapon::dealDamageToTarget ( Target  tgt,
double  dt 
)

void FastEcslent::Weapon::setTarget (  ) 

Target FastEcslent::Weapon::getTarget (  ) 

void FastEcslent::Weapon::takeDamage ( double  amt,
double  dt 
)

virtual void FastEcslent::Weapon::tick ( double  dt  )  [virtual]

Reimplemented from FastEcslent::UnitAspect.

virtual void FastEcslent::Weapon::init (  )  [virtual]

Reimplemented from FastEcslent::UnitAspect.

std::vector<Entity*> FastEcslent::Weapon::getUnitsInRadius ( Entity ent,
double  radius,
bool  enemy 
) [private]

std::vector<FastEcslent::Entity*> FastEcslent::Weapon::getUnitsInRectangle ( Entity src,
Entity tgt,
double  length,
double  width,
bool  enemy 
) [private]

bool FastEcslent::Weapon::isPointInRectangle ( Ogre::Vector3  sp1,
Ogre::Vector3  sp2,
Ogre::Vector3  sp3,
Ogre::Vector3  sp4,
Ogre::Vector3  point 
) [private]

double FastEcslent::Weapon::getAreaTriangle ( Ogre::Vector3  tp1,
Ogre::Vector3  tp2,
Ogre::Vector3  tp3 
) [private]

void FastEcslent::Weapon::dealDamageToTarget ( Target  tgt,
double  dt 
)

void FastEcslent::Weapon::dealEnemySplashDamageToTarget ( Target  tgt,
double  dt,
double  radius 
)

deal circle shapedsplash damage in front of the unit, like Hellion in StarCraft 2

void FastEcslent::Weapon::dealLineSplashDamageToTarget ( Target  tgt,
double  dt,
double  length,
double  width 
)

deal line shaped splash damage in front of the unit, like Hellion in StarCraft 2

void FastEcslent::Weapon::setTarget (  ) 

Target FastEcslent::Weapon::getTarget (  ) 

void FastEcslent::Weapon::takeDamage ( double  amt  ) 

void FastEcslent::Weapon::takeDamage ( double  amt,
double  dt 
)

virtual void FastEcslent::Weapon::tick ( double  dt  )  [virtual]

Reimplemented from FastEcslent::UnitAspect.

virtual void FastEcslent::Weapon::init (  )  [virtual]

Reimplemented from FastEcslent::UnitAspect.

double FastEcslent::Weapon::isBeingAttacked (  )  [inline]

Definition at line 69 of file unitWeapons.h.

References m_beingAttacked.

void FastEcslent::Weapon::resetBeingAttack (  )  [inline]

Definition at line 70 of file unitWeapons.h.

References m_beingAttacked.

void FastEcslent::Weapon::dealDamageToTarget ( Target  tgt,
double  dt 
)

void FastEcslent::Weapon::setTarget (  ) 

Target FastEcslent::Weapon::getTarget (  ) 

void FastEcslent::Weapon::takeDamage ( double  amt,
double  dt 
)

virtual void FastEcslent::Weapon::tick ( double  dt  )  [virtual]

Reimplemented from FastEcslent::UnitAspect.

virtual void FastEcslent::Weapon::init (  )  [virtual]

Reimplemented from FastEcslent::UnitAspect.


Member Data Documentation

Target FastEcslent::Weapon::target [private]

Definition at line 26 of file unitWeapons.h.

Referenced by tick().

int FastEcslent::Weapon::STANDSTILL [private]

Definition at line 32 of file unitWeapons.h.

Referenced by dealDamageToTarget(), dealEnemySplashDamageToTarget(), dealLineSplashDamageToTarget(), and init().

int FastEcslent::Weapon::BEINGATTACKED [private]

Definition at line 33 of file unitWeapons.h.

Referenced by init(), and takeDamage().

double FastEcslent::Weapon::m_cooldown [private]

Definition at line 34 of file unitWeapons.h.

Referenced by dealDamageToTarget(), dealEnemySplashDamageToTarget(), dealLineSplashDamageToTarget(), init(), and tick().

double FastEcslent::Weapon::m_beingAttacked [private]

Definition at line 35 of file unitWeapons.h.

Referenced by init(), isBeingAttacked(), resetBeingAttack(), takeDamage(), and tick().

double FastEcslent::Weapon::m_onfire [private]

Definition at line 37 of file unitWeapons.h.

Referenced by dealDamageToTarget(), dealEnemySplashDamageToTarget(), dealLineSplashDamageToTarget(), init(), and tick().

WeaponType FastEcslent::Weapon::weaponType

Definition at line 39 of file unitWeapons.h.

Referenced by dealDamageToTarget(), dealEnemySplashDamageToTarget(), dealLineSplashDamageToTarget(), init(), tick(), and Weapon().

double FastEcslent::Weapon::damageMultiplier

Definition at line 42 of file unitWeapons.h.

Referenced by init().

double FastEcslent::Weapon::armor

Definition at line 47 of file unitWeapons.h.

Referenced by init(), and takeDamage().

DistanceMgr* FastEcslent::Weapon::distanceMgr

Definition at line 49 of file unitWeapons.h.

Referenced by init(), and tick().

WeaponMgr* FastEcslent::Weapon::weaponMgr

Definition at line 50 of file unitWeapons.h.

Referenced by init().

WeaponType FastEcslent::Weapon::weaponType

Definition at line 29 of file unitWeapons.h.

double FastEcslent::Weapon::damageDone

Definition at line 31 of file unitWeapons.h.

double FastEcslent::Weapon::hitpoints

Definition at line 35 of file unitWeapons.h.

DistanceMgr* FastEcslent::Weapon::distanceMgr

Definition at line 38 of file unitWeapons.h.

WeaponMgr* FastEcslent::Weapon::weaponMgr

Definition at line 39 of file unitWeapons.h.

DistanceMgr* FastEcslent::Weapon::distanceMgr

Definition at line 38 of file unitWeapons.h.

WeaponMgr* FastEcslent::Weapon::weaponMgr

Definition at line 39 of file unitWeapons.h.

const WeaponType* FastEcslent::Weapon::weaponType

Definition at line 39 of file unitWeapons.h.

DistanceMgr* FastEcslent::Weapon::distanceMgr

Definition at line 45 of file unitWeapons.h.

WeaponMgr* FastEcslent::Weapon::weaponMgr

Definition at line 46 of file unitWeapons.h.

DistanceMgr* FastEcslent::Weapon::distanceMgr

Definition at line 38 of file unitWeapons.h.

WeaponMgr* FastEcslent::Weapon::weaponMgr

Definition at line 39 of file unitWeapons.h.


The documentation for this class was generated from the following files:
Generated on Fri Dec 13 14:54:21 2013 for FastECSLent by  doxygen 1.5.4