16 #include "ShooterLibrary.h" 31 virtual void Update(
const GameTime *pGameTime);
35 virtual void Draw(SpriteBatch *pSpriteBatch) = 0;
39 virtual void Hit(
const float damage);
49 virtual void SetInvulnurable(
bool isInvulnurable =
true) { m_isInvulnurable = isInvulnurable; }
53 virtual std::string
ToString()
const {
return "Ship"; }
73 virtual float GetSpeed()
const {
return m_speed; }
77 virtual void SetSpeed(
const float speed) { m_speed = speed; }
81 virtual void SetMaxHitPoints(
const float hitPoints) { m_maxHitPoints = hitPoints; }
100 bool m_isInvulnurable;
102 std::vector<Weapon *> m_weapons;
103 std::vector<Weapon *>::iterator m_weaponIt;
Defines how different types of weapons should be triggered.
Definition: TriggerType.h:20
virtual void AttachWeapon(Weapon *pWeapon, Vector2 position)
Attaches a weapon to the ship.
Definition: Ship.cpp:68
virtual CollisionType GetCollisionType() const =0
Gets the collision type mask.
virtual void SetInvulnurable(bool isInvulnurable=true)
Sets whether or not the ship takes damage.
Definition: Ship.h:49
virtual void Draw(SpriteBatch *pSpriteBatch)=0
Called when the game determines it is time to draw a frame.
virtual void Hit(const float damage)
Hits the ship, dealing damage to it.
Definition: Ship.cpp:41
virtual void Update(const GameTime *pGameTime)
Updates the game object.
Definition: Ship.cpp:30
Base class for all objects that will be updated and rendered on a GameplayScreen. ...
Definition: GameObject.h:29
Shooter Library is a library of classes, interfaces, and value types that provides a foundation for d...
Definition: Background.h:16
virtual bool IsInvulnurable() const
Determines if the ship takes damage.
Definition: Ship.h:44
virtual void SetMaxHitPoints(const float hitPoints)
Sets the maximum hit points of the ship.
Definition: Ship.h:81
virtual std::string ToString() const
Gets a string representation of the ship.
Definition: Ship.h:53
virtual float GetSpeed() const
Gets the speed of the projectile in pixels per second.
Definition: Ship.h:73
virtual Weapon * GetWeapon(const int index)
Gets the weapon at the specified index.
Definition: Ship.h:90
virtual void Initialize()
Initializes the ship.
Definition: Ship.cpp:54
static const TriggerType ALL
Represents a combination of all weapon triggers.
Definition: TriggerType.h:34
Base class for all Weapons.
Definition: Weapon.h:19
virtual void SetSpeed(const float speed)
Sets the speed of the ship.
Definition: Ship.h:77
virtual void FireWeapons(TriggerType type=TriggerType::ALL)
Fires the ship's weapons.
Definition: Ship.cpp:59
Base class for all ships.
Definition: Ship.h:22
Defines the types of game objects that can collide with each other.
Definition: CollisionType.h:20