Jetpack documentation 1.0.0
Loading...
Searching...
No Matches
Trap Class Reference

A class that represents a zapper in the game. More...

#include <Trap.hpp>

Public Member Functions

 Trap (std::array< float, 2 > position, sf::Sprite &sprite, sf::Sound &sound, Player::PlayerState player_state=Player::PlayerState::NORMAL)
 Constructor for Trap class.
 
 ~Trap ()
 Destructor for Trap class.
 
const std::array< float, 2 > & getPosition () const
 Gets the position of the Trap.
 
sf::Sprite & getSprite ()
 Gets the sprite of the Trap.
 
sf::Sound & getSound ()
 Gets the sound of the Trap.
 
const Player::PlayerState & getPlayerState () const
 Gets the state of the player after being hit by the Trap.
 

Private Attributes

std::array< float, 2 > _position
 
sf::Sprite & _sprite
 
sf::Sound & _sound
 
Player::PlayerState _player_state
 

Detailed Description

A class that represents a zapper in the game.

Constructor & Destructor Documentation

◆ Trap()

Trap ( std::array< float, 2 > position,
sf::Sprite & sprite,
sf::Sound & sound,
Player::PlayerState player_state = Player::PlayerState::NORMAL )

Constructor for Trap class.

Parameters
positionThe position of the Trap
spriteThe sprite of the Trap
soundThe sound of the Trap
player_stateThe state of the player after being hit by the Trap

Member Function Documentation

◆ getPlayerState()

const Player::PlayerState & getPlayerState ( ) const

Gets the state of the player after being hit by the Trap.

Returns
The state of the player after being hit by the Trap

◆ getPosition()

const std::array< float, 2 > & getPosition ( ) const

Gets the position of the Trap.

Returns
The position of the Trap

◆ getSound()

sf::Sound & getSound ( )

Gets the sound of the Trap.

Returns
The sound of the Trap

◆ getSprite()

sf::Sprite & getSprite ( )

Gets the sprite of the Trap.

Returns
The sprite of the Trap

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