Base class for all weapons that can be fired by a game object.
More...
#include <Weapon.h>
Base class for all weapons that can be fired by a game object.
Definition at line 11 of file Weapon.h.
◆ Weapon()
Instantiate a weapon object.
- Parameters
-
| isActive | A flag to determine if the weapon is active. |
Definition at line 18 of file Weapon.h.
◆ ~Weapon()
| virtual Weapon::~Weapon |
( |
| ) |
|
|
inlinevirtual |
◆ Activate()
| virtual void Weapon::Activate |
( |
| ) |
|
|
inlinevirtual |
Activate the weapon.
Definition at line 61 of file Weapon.h.
◆ AttachTo()
Attach the weapon to a game object.
- Parameters
-
| pAttachable | A pointer to the attachable game object. |
| position | The offset position of the weapon relative to the game object. |
Implements KatanaEngine::IAttachment.
Definition at line 85 of file Weapon.h.
◆ Dectivate()
| virtual void Weapon::Dectivate |
( |
| ) |
|
|
inlinevirtual |
Deactivate the weapon.
Definition at line 64 of file Weapon.h.
◆ Draw()
Render the weapon.
- Parameters
-
| spriteBatch | A reference to the game's sprite batch, used for rendering. |
Definition at line 34 of file Weapon.h.
◆ Fire()
Attempt to fire the weapon.
- Parameters
-
| triggerType | The type of trigger that fired the weapon. |
Implemented in Blaster.
◆ GetAttachmentType()
| virtual std::string Weapon::GetAttachmentType |
( |
| ) |
const |
|
inlinevirtual |
◆ GetFireSound()
Get the sound that will be played when the weapon is fired.
- Returns
- A pointer to the audio sample.
Definition at line 76 of file Weapon.h.
◆ GetKey()
| virtual std::string Weapon::GetKey |
( |
| ) |
const |
|
inlinevirtual |
◆ GetPosition()
| virtual Vector2 Weapon::GetPosition |
( |
| ) |
const |
|
inlineprotectedvirtual |
Get the screen position of the weapon.
- Returns
- The screen position of the weapon.
Definition at line 104 of file Weapon.h.
◆ GetProjectile()
Get a projectile from the pool.
- Returns
- A pointer to a projectile.
Definition at line 109 of file Weapon.h.
◆ GetTriggerType()
Get the game object that the weapon is attached to.
- Returns
- A pointer to the game object.
Definition at line 100 of file Weapon.h.
◆ IsActive()
| virtual bool Weapon::IsActive |
( |
| ) |
const |
|
inlinevirtual |
Determine if the weapon is active.
- Returns
- True if the weapon is active.
Definition at line 68 of file Weapon.h.
◆ IsAttachedToPlayer()
| virtual bool Weapon::IsAttachedToPlayer |
( |
| ) |
const |
|
inlinevirtual |
Determine if the weapon is attached to the player.
- Returns
- True if the weapon is attached to the player.
Definition at line 80 of file Weapon.h.
◆ SetFireSound()
| virtual void Weapon::SetFireSound |
( |
AudioSample * | pSound | ) |
|
|
inlinevirtual |
Set the sound that will be played when the weapon is fired.
- Parameters
-
| pSound | A pointer to the audio sample. |
Definition at line 72 of file Weapon.h.
◆ SetProjectilePool()
| virtual void Weapon::SetProjectilePool |
( |
std::vector< Projectile * > * | pProjectiles | ) |
|
|
inlinevirtual |
Set the pool of projectiles that the weapon can fire.
- Parameters
-
| pProjectiles | A pointer to the projectile pool. |
- See also
- GetProjectile
Definition at line 58 of file Weapon.h.
◆ SetTriggerType()
| virtual void Weapon::SetTriggerType |
( |
TriggerType | triggerType | ) |
|
|
inlinevirtual |
Set the game object that the weapon is attached to.
- Parameters
-
| pGameObject | A pointer to the game object. |
Set the offset of the weapon from the game object's position.
- Parameters
-
| offset | The offset of the weapon. |
Set the type of trigger that can fire the weapon.
- Parameters
-
| triggerType | The type of trigger. |
Definition at line 53 of file Weapon.h.
◆ Update()
| virtual void Weapon::Update |
( |
const GameTime & | gameTime | ) |
|
|
inlinevirtual |
The documentation for this class was generated from the following file: