Arcade Shooter
Public Member Functions | List of all members
ShooterLibrary::Gun< T > Class Template Reference

A weapon type that shoots. More...

#include <Gun.h>

Inheritance diagram for ShooterLibrary::Gun< T >:
ShooterLibrary::Weapon

Public Member Functions

 Gun (const bool isActive)
 Instantiates a new weapon object. More...
 
virtual void Update (const GameTime *pGameTime)
 Called when the game determines it is time to draw a frame. More...
 
virtual void Fire (TriggerType triggerType)
 Fires the weapon. More...
 
virtual void SetProjectilePool (ProjectilePool *pPool)
 Sets the pool where the weapon gets it's projectiles. More...
 
virtual bool CanFire () const
 Determines if the weapon is ready to fire. More...
 
virtual void SetCooldownSeconds (const float seconds)
 Sets the time in seconds that the weapon takes between firing. More...
 
virtual void ResetCooldown ()
 Instantly cools the weapon, making it ready to fire.
 
- Public Member Functions inherited from ShooterLibrary::Weapon
 Weapon (bool isActive=true)
 Instantiates a new weapon object. More...
 
virtual void Draw (SpriteBatch *pSpriteBatch)
 Called when the game determines it is time to draw a frame. More...
 
virtual void SetGameObject (GameObject *pGameObject)
 Sets the game object that the weapon is attached to. More...
 
virtual void SetOffset (Vector2 offset)
 Sets the position on the parented game object. More...
 
virtual void SetTriggerType (TriggerType triggerType)
 Sets how the weapon is triggered. More...
 
virtual void Activate ()
 Activates the weapon.
 
virtual void Dectivate ()
 Deactivates the weapon.
 
virtual bool IsActive () const
 Determines if the weapon is active. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ShooterLibrary::Weapon
virtual TriggerType GetTriggerType () const
 Gets the action that triggers the weapon. More...
 
virtual Vector2 GetPosition () const
 Gets the weapon's position. More...
 

Detailed Description

template<typename T>
class ShooterLibrary::Gun< T >

A weapon type that shoots.

Constructor & Destructor Documentation

◆ Gun()

template<typename T>
ShooterLibrary::Gun< T >::Gun ( const bool  isActive)
inline

Instantiates a new weapon object.

Parameters
isActiveSpecifies if the weapon is active.

Member Function Documentation

◆ CanFire()

template<typename T>
virtual bool ShooterLibrary::Gun< T >::CanFire ( ) const
inlinevirtual

Determines if the weapon is ready to fire.

Returns
Returns true if the weapon can fire, false otherwise.

◆ Fire()

template<typename T>
virtual void ShooterLibrary::Gun< T >::Fire ( TriggerType  triggerType)
inlinevirtual

Fires the weapon.

Parameters
triggerTypeSpecifies how the weapon is triggered.

Implements ShooterLibrary::Weapon.

◆ SetCooldownSeconds()

template<typename T>
virtual void ShooterLibrary::Gun< T >::SetCooldownSeconds ( const float  seconds)
inlinevirtual

Sets the time in seconds that the weapon takes between firing.

Parameters
secondsThe time between firing shots.

◆ SetProjectilePool()

template<typename T>
virtual void ShooterLibrary::Gun< T >::SetProjectilePool ( ProjectilePool pPool)
inlinevirtual

Sets the pool where the weapon gets it's projectiles.

Parameters
pPoolThe pool to use.

Implements ShooterLibrary::Weapon.

◆ Update()

template<typename T>
virtual void ShooterLibrary::Gun< T >::Update ( const GameTime *  pGameTime)
inlinevirtual

Called when the game determines it is time to draw a frame.

Parameters
pGameTimeTiming values including time since last update.

Reimplemented from ShooterLibrary::Weapon.


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