Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
WeaponSet Class Reference

#include <WeaponSet.h>

Inherits Snapshot.

Public Member Functions

 WeaponSet ()
 
 ~WeaponSet ()
 
void updateWeaponSet (const Object *obj)
 
void reloadAllAmmo (const Object *obj, Bool now)
 
Bool isOutOfAmmo () const
 
Bool hasAnyWeapon () const
 
Bool hasAnyDamageWeapon () const
 
Bool hasWeaponToDealDamageType (DamageType typeToDeal) const
 
Bool hasSingleDamageType (DamageType typeToDeal) const
 
Bool isCurWeaponLocked () const
 
WeapongetCurWeapon ()
 
const WeapongetCurWeapon () const
 
WeaponSlotType getCurWeaponSlot () const
 
WeaponfindWaypointFollowingCapableWeapon ()
 
const WeaponfindAmmoPipShowingWeapon () const
 
void weaponSetOnWeaponBonusChange (const Object *source)
 
UnsignedInt getMostPercentReadyToFireAnyWeapon () const
 
UnsignedInt getNthCommandSourceMask (WeaponSlotType n) const
 
Bool setWeaponLock (WeaponSlotType weaponSlot, WeaponLockType lockType)
 
void releaseWeaponLock (WeaponLockType lockType)
 
Bool isSharedReloadTime () const
 
void clearLeechRangeModeForAllWeapons ()
 
CanAttackResult getAbleToAttackSpecificObject (AbleToAttackType t, const Object *obj, const Object *victim, CommandSourceType commandSource, WeaponSlotType specificSlot=(WeaponSlotType) -1) const
 
CanAttackResult getAbleToUseWeaponAgainstTarget (AbleToAttackType attackType, const Object *source, const Object *victim, const Coord3D *pos, CommandSourceType commandSource, WeaponSlotType specificSlot=(WeaponSlotType) -1) const
 
Bool chooseBestWeaponForTarget (const Object *obj, const Object *victim, WeaponChoiceCriteria criteria, CommandSourceType cmdSource)
 
WeapongetWeaponInWeaponSlot (WeaponSlotType wslot) const
 
- Public Member Functions inherited from Snapshot
 Snapshot (void)
 
 ~Snapshot (void)
 

Static Public Member Functions

static ModelConditionFlags getModelConditionForWeaponSlot (WeaponSlotType wslot, WeaponSetConditionType a)
 

Protected Member Functions

virtual void crc (Xfer *xfer)
 
virtual void xfer (Xfer *xfer)
 
virtual void loadPostProcess (void)
 

Detailed Description

Definition at line 198 of file WeaponSet.h.

Constructor & Destructor Documentation

◆ WeaponSet()

WeaponSet::WeaponSet ( )

Definition at line 179 of file WeaponSet.cpp.

◆ ~WeaponSet()

WeaponSet::~WeaponSet ( )

Definition at line 194 of file WeaponSet.cpp.

Member Function Documentation

◆ chooseBestWeaponForTarget()

Bool WeaponSet::chooseBestWeaponForTarget ( const Object * obj,
const Object * victim,
WeaponChoiceCriteria criteria,
CommandSourceType cmdSource )

Selects the best weapon for the given target, and sets it as the current weapon. If there is no weapon that can damage the target, false is returned (and the current-weapon is unchanged). Note that this DOES take weapon attack range into account.

Definition at line 788 of file WeaponSet.cpp.

◆ clearLeechRangeModeForAllWeapons()

void WeaponSet::clearLeechRangeModeForAllWeapons ( )

Definition at line 1125 of file WeaponSet.cpp.

◆ crc()

void WeaponSet::crc ( Xfer * xfer)
protectedvirtual

CRC

Implements Snapshot.

Definition at line 204 of file WeaponSet.cpp.

◆ findAmmoPipShowingWeapon()

const Weapon * WeaponSet::findAmmoPipShowingWeapon ( ) const

Definition at line 1008 of file WeaponSet.cpp.

◆ findWaypointFollowingCapableWeapon()

Weapon * WeaponSet::findWaypointFollowingCapableWeapon ( )

Definition at line 1022 of file WeaponSet.cpp.

◆ getAbleToAttackSpecificObject()

CanAttackResult WeaponSet::getAbleToAttackSpecificObject ( AbleToAttackType t,
const Object * obj,
const Object * victim,
CommandSourceType commandSource,
WeaponSlotType specificSlot = (WeaponSlotType)-1 ) const

Determines if the unit has any weapon that could conceivably harm the victim. this does not take range, ammo, etc. into account, but immutable weapon properties, such as "can you target airborne victims".

Definition at line 447 of file WeaponSet.cpp.

◆ getAbleToUseWeaponAgainstTarget()

CanAttackResult WeaponSet::getAbleToUseWeaponAgainstTarget ( AbleToAttackType attackType,
const Object * source,
const Object * victim,
const Coord3D * pos,
CommandSourceType commandSource,
WeaponSlotType specificSlot = (WeaponSlotType)-1 ) const

Definition at line 605 of file WeaponSet.cpp.

◆ getCurWeapon() [1/2]

Weapon * WeaponSet::getCurWeapon ( )
inline

Definition at line 232 of file WeaponSet.h.

◆ getCurWeapon() [2/2]

const Weapon * WeaponSet::getCurWeapon ( ) const
inline

Definition at line 233 of file WeaponSet.h.

◆ getCurWeaponSlot()

WeaponSlotType WeaponSet::getCurWeaponSlot ( ) const
inline

Definition at line 234 of file WeaponSet.h.

◆ getModelConditionForWeaponSlot()

ModelConditionFlags WeaponSet::getModelConditionForWeaponSlot ( WeaponSlotType wslot,
WeaponSetConditionType a )
static

Definition at line 348 of file WeaponSet.cpp.

◆ getMostPercentReadyToFireAnyWeapon()

UnsignedInt WeaponSet::getMostPercentReadyToFireAnyWeapon ( ) const

Definition at line 1035 of file WeaponSet.cpp.

◆ getNthCommandSourceMask()

UnsignedInt WeaponSet::getNthCommandSourceMask ( WeaponSlotType n) const
inline

Definition at line 239 of file WeaponSet.h.

◆ getWeaponInWeaponSlot()

Weapon * WeaponSet::getWeaponInWeaponSlot ( WeaponSlotType wslot) const

Definition at line 1117 of file WeaponSet.cpp.

◆ hasAnyDamageWeapon()

Bool WeaponSet::hasAnyDamageWeapon ( ) const
inline

Definition at line 228 of file WeaponSet.h.

◆ hasAnyWeapon()

Bool WeaponSet::hasAnyWeapon ( ) const
inline

Definition at line 227 of file WeaponSet.h.

◆ hasSingleDamageType()

Bool WeaponSet::hasSingleDamageType ( DamageType typeToDeal) const
inline

Definition at line 230 of file WeaponSet.h.

◆ hasWeaponToDealDamageType()

Bool WeaponSet::hasWeaponToDealDamageType ( DamageType typeToDeal) const
inline

Definition at line 229 of file WeaponSet.h.

◆ isCurWeaponLocked()

Bool WeaponSet::isCurWeaponLocked ( ) const
inline

Definition at line 231 of file WeaponSet.h.

◆ isOutOfAmmo()

Bool WeaponSet::isOutOfAmmo ( ) const

Definition at line 992 of file WeaponSet.cpp.

◆ isSharedReloadTime()

Bool WeaponSet::isSharedReloadTime ( ) const

Definition at line 1139 of file WeaponSet.cpp.

◆ loadPostProcess()

void WeaponSet::loadPostProcess ( void )
protectedvirtual

Load post process

Implements Snapshot.

Definition at line 293 of file WeaponSet.cpp.

◆ releaseWeaponLock()

void WeaponSet::releaseWeaponLock ( WeaponLockType lockType)

Definition at line 1094 of file WeaponSet.cpp.

◆ reloadAllAmmo()

void WeaponSet::reloadAllAmmo ( const Object * obj,
Bool now )

Definition at line 976 of file WeaponSet.cpp.

◆ setWeaponLock()

Bool WeaponSet::setWeaponLock ( WeaponSlotType weaponSlot,
WeaponLockType lockType )

Definition at line 1059 of file WeaponSet.cpp.

◆ updateWeaponSet()

void WeaponSet::updateWeaponSet ( const Object * obj)

Definition at line 299 of file WeaponSet.cpp.

◆ weaponSetOnWeaponBonusChange()

void WeaponSet::weaponSetOnWeaponBonusChange ( const Object * source)

Definition at line 417 of file WeaponSet.cpp.

◆ xfer()

void WeaponSet::xfer ( Xfer * xfer)
protectedvirtual

Xfer method Version Info: 1: Initial version

Implements Snapshot.

Definition at line 214 of file WeaponSet.cpp.


The documentation for this class was generated from the following files: