Arcade Shooter
Public Member Functions | Protected Member Functions | List of all members
ShooterLibrary::Weapon Class Referenceabstract

Base class for all Weapons. More...

#include <Weapon.h>

Inheritance diagram for ShooterLibrary::Weapon:
ShooterLibrary::Gun< Missile > ShooterLibrary::Gun< Projectile > ShooterLibrary::Gun< T > Sample::Launcher Sample::Blaster

Public Member Functions

 Weapon (bool isActive=true)
 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 Draw (SpriteBatch *pSpriteBatch)
 Called when the game determines it is time to draw a frame. More...
 
virtual void Fire (TriggerType triggerType)=0
 Fires the weapon. 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 SetProjectilePool (ProjectilePool *pPool)=0
 Sets the pool where the weapon gets it's projectiles. More...
 
virtual void Activate ()
 Activates the weapon.
 
virtual void Dectivate ()
 Deactivates the weapon.
 
virtual bool IsActive () const
 Determines if the weapon is active. More...
 

Protected Member Functions

virtual TriggerType GetTriggerType () const
 Gets the action that triggers the weapon. More...
 
virtual Vector2 GetPosition () const
 Gets the weapon's position. More...
 

Detailed Description

Base class for all Weapons.

Constructor & Destructor Documentation

◆ Weapon()

ShooterLibrary::Weapon::Weapon ( bool  isActive = true)
inline

Instantiates a new weapon object.

Parameters
isActiveSpecifies if the weapon is active.

Member Function Documentation

◆ Draw()

virtual void ShooterLibrary::Weapon::Draw ( SpriteBatch *  pSpriteBatch)
inlinevirtual

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

Parameters
pSpriteBatchThe game's sprite batch, used for rendering.

◆ Fire()

virtual void ShooterLibrary::Weapon::Fire ( TriggerType  triggerType)
pure virtual

Fires the weapon.

Parameters
triggerTypeSpecifies how the weapon is triggered.

Implemented in ShooterLibrary::Gun< T >, ShooterLibrary::Gun< Projectile >, and ShooterLibrary::Gun< Missile >.

◆ GetPosition()

virtual Vector2 ShooterLibrary::Weapon::GetPosition ( ) const
inlineprotectedvirtual

Gets the weapon's position.

Returns
Returns the position of the weapon.

◆ GetTriggerType()

virtual TriggerType ShooterLibrary::Weapon::GetTriggerType ( ) const
inlineprotectedvirtual

Gets the action that triggers the weapon.

Returns
Returns the type of trigger that fires the weapon.

◆ IsActive()

virtual bool ShooterLibrary::Weapon::IsActive ( ) const
inlinevirtual

Determines if the weapon is active.

Returns
Returns true if the weapon is active, false otherwise.

◆ SetGameObject()

virtual void ShooterLibrary::Weapon::SetGameObject ( GameObject pGameObject)
inlinevirtual

Sets the game object that the weapon is attached to.

Parameters
pGameObjectThe attached game object.

◆ SetOffset()

virtual void ShooterLibrary::Weapon::SetOffset ( Vector2  offset)
inlinevirtual

Sets the position on the parented game object.

Parameters
offsetThe position on the game object.

◆ SetProjectilePool()

virtual void ShooterLibrary::Weapon::SetProjectilePool ( ProjectilePool pPool)
pure virtual

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

Parameters
pPoolThe pool to use.

Implemented in ShooterLibrary::Gun< T >, ShooterLibrary::Gun< Projectile >, and ShooterLibrary::Gun< Missile >.

◆ SetTriggerType()

virtual void ShooterLibrary::Weapon::SetTriggerType ( TriggerType  triggerType)
inlinevirtual

Sets how the weapon is triggered.

Parameters
triggerTypeSpecifies how the weapon is triggered.

◆ Update()

virtual void ShooterLibrary::Weapon::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 in ShooterLibrary::Gun< T >, ShooterLibrary::Gun< Projectile >, and ShooterLibrary::Gun< Missile >.


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