Represents a ship in the game.
More...
#include <Ship.h>
Represents a ship in the game.
Definition at line 8 of file Ship.h.
◆ Ship()
Creates a new instance of Ship.
Definition at line 6 of file Ship.cpp.
◆ ~Ship()
◆ AttachItem()
Attaches a weapon to the ship.
- Parameters
-
| pWeapon | A pointer to the weapon to attach. |
| position | The position on the ship that the weapon will be attached, offset from the center of the ship. |
Definition at line 83 of file Ship.cpp.
◆ Draw()
◆ FireWeapons()
Fires the ship's weapons.
- Parameters
-
| type | The type of trigger that fired the weapons. |
Definition at line 61 of file Ship.cpp.
◆ GetAttachment() [1/2]
◆ GetAttachment() [2/2]
| IAttachment * Ship::GetAttachment |
( |
const std::string & | key | ) |
|
|
virtual |
◆ GetCollisionType()
Gets the collision type of the ship.
- Returns
- Returns the collision type of the ship.
Implements GameObject.
Implemented in EnemyShip, and PlayerShip.
◆ GetHitPoints()
| virtual float Ship::GetHitPoints |
( |
| ) |
const |
|
inlineprotectedvirtual |
Gets the current hit points of the ship.
- Returns
- Returns the current hit points of the ship.
Definition at line 91 of file Ship.h.
◆ GetMaxHitPoints()
| virtual float Ship::GetMaxHitPoints |
( |
| ) |
const |
|
inlineprotectedvirtual |
Gets the max hit points of the ship.
- Returns
- Returns the max hit points of the ship.
Definition at line 95 of file Ship.h.
◆ GetSpeed()
| virtual float Ship::GetSpeed |
( |
| ) |
const |
|
inlinevirtual |
Gets the speed of the ship.
- Returns
- Returns the speed of the ship.
Definition at line 55 of file Ship.h.
◆ GetWeapon()
| virtual Weapon * Ship::GetWeapon |
( |
const std::string & | key | ) |
|
|
inlineprotectedvirtual |
Gets a weapon from the ship's weapon list.
- Parameters
-
| index | The index of the weapon to get. |
- Returns
- Returns a pointer to the weapon.
Definition at line 83 of file Ship.h.
◆ Hit()
| void Ship::Hit |
( |
const float | damage | ) |
|
|
virtual |
Applies damage to the ship.
- Parameters
-
| damage | The amount of damage to apply. |
Reimplemented from GameObject.
Reimplemented in EnemyShip.
Definition at line 26 of file Ship.cpp.
◆ Initialize()
| void Ship::Initialize |
( |
| ) |
|
|
protectedvirtual |
Initializes the ship.
Definition at line 56 of file Ship.cpp.
◆ IsInvulnurable()
| virtual bool Ship::IsInvulnurable |
( |
| ) |
const |
|
inlinevirtual |
To determine if the ship should take damage when hit.
- Returns
- True if the ship is invulnerable, false otherwise.
Definition at line 31 of file Ship.h.
◆ SetInvulnurable()
| virtual void Ship::SetInvulnurable |
( |
bool | isInvulnurable = true | ) |
|
|
inlinevirtual |
Sets the invulnerability of the ship.
- Parameters
-
| isInvulnurable | True to make the ship invulnerable, false otherwise. |
Definition at line 35 of file Ship.h.
◆ SetMaxHitPoints()
| virtual void Ship::SetMaxHitPoints |
( |
const float | hitPoints | ) |
|
|
inlinevirtual |
Sets the max hit points of the ship.
- Parameters
-
| hitPoints | The max hit points of the ship. |
Definition at line 63 of file Ship.h.
◆ SetSpeed()
| virtual void Ship::SetSpeed |
( |
const float | speed | ) |
|
|
inlinevirtual |
Sets the speed of the ship.
- Parameters
-
| speed | The speed of the ship. |
Definition at line 59 of file Ship.h.
◆ ToString()
| virtual std::string Ship::ToString |
( |
| ) |
const |
|
inlinevirtual |
◆ Update()
| void Ship::Update |
( |
const GameTime & | gameTime | ) |
|
|
virtual |
The documentation for this class was generated from the following files: