Jetpack documentation 1.0.0
Loading...
Searching...
No Matches
Trap.hpp
Go to the documentation of this file.
1/*
2** EPITECH PROJECT, 2025
3** jetpack
4** File description:
5** The Trap.hpp
6*/
13#ifndef ZAPPER_HPP_
14 #define ZAPPER_HPP_
15
16 #include "client/Player.hpp"
17
18namespace Jetpack {
23 class Trap
24 {
25 public:
26 /* Constructor and destructor */
27
35 Trap(std::array<float, 2> position,
36 sf::Sprite &sprite, sf::Sound &sound,
37 Player::PlayerState player_state = Player::PlayerState::NORMAL);
41 ~Trap();
42
43
44
45 /* Getter and Setter for Trap information */
46
51 const std::array<float, 2> &getPosition() const;
56 sf::Sprite &getSprite();
61 sf::Sound &getSound();
66 const Player::PlayerState &getPlayerState() const;
67
68
69
70 private:
71 std::array<float, 2> _position; /* Position of the Trap */
72 sf::Sprite &_sprite; /* Sprite of the Trap */
73 sf::Sound &_sound; /* Sound of the Trap */
74 Player::PlayerState _player_state; /* State of the player after being hit by the Trap */
75 };
76}
77
78
79#endif /* ZAPPER_HPP_ */
The Player.hpp.
A class that represents a zapper in the game.
Definition Trap.hpp:24
Trap(std::array< float, 2 > position, sf::Sprite &sprite, sf::Sound &sound, Player::PlayerState player_state=Player::PlayerState::NORMAL)
Constructor for Trap class.
Definition Trap.cpp:23
sf::Sprite & getSprite()
Gets the sprite of the Trap.
Definition Trap.cpp:53
~Trap()
Destructor for Trap class.
Definition Trap.cpp:35
sf::Sound & getSound()
Gets the sound of the Trap.
Definition Trap.cpp:62
const std::array< float, 2 > & getPosition() const
Gets the position of the Trap.
Definition Trap.cpp:44
const Player::PlayerState & getPlayerState() const
Gets the state of the player after being hit by the Trap.
Definition Trap.cpp:71