R-Type  2
Doom but in better
Loading...
Searching...
No Matches
GUI::ECS::Systems::MouseInfo Class Reference

#include <MouseInfo.hpp>

Inheritance diagram for GUI::ECS::Systems::MouseInfo:
Inheritance graph
Collaboration diagram for GUI::ECS::Systems::MouseInfo:
Collaboration graph

Public Member Functions

 MouseInfo (const std::uint32_t entityId=0)
 Constructs a new MouseInfo object with default values.
 
 ~MouseInfo ()
 Destroys the MouseInfo object.
 
void update (const std::any &event)
 Processes and updates the internal state based on a given sf::Event.
 
void update (const MouseInfo &entity)
 Update the values of the class with the content of another class.
 
void update (const std::pair< int, int > &position)
 Updates the mouse position using an integer-based vector.
 
const std::pair< int, int > getMousePosition () const
 Retrieves the current mouse position.
 
const bool isMouseInFocus () const
 Checks if the mouse is in the window.
 
const bool isMouseLeftButtonClicked () const
 Checks if the left mouse button is pressed.
 
const bool isMouseMiddleButtonClicked () const
 Checks if the middle mouse button is pressed.
 
const bool isMouseRightButtonClicked () const
 Checks if the right mouse button is pressed.
 
const bool isMouseExtra1ButtonClicked () const
 Checks if the extra1 mouse button is pressed.
 
const bool isMouseExtra2ButtonClicked () const
 Checks if the extra2 mouse button is pressed.
 
const bool isMouseWheelScrolled () const
 Check if the mouse has scrolled.
 
const bool isMouseWheelScrolledUp () const
 Check if the mouse has scrolled upwards.
 
const bool isMouseWheelScrolledDown () const
 Check if the mouse has scrolled downwards.
 
const bool isMouseWheelScrolledLeft () const
 Check if the mouse has scrolled to the left.
 
const bool isMouseWheelScrolledRight () const
 Check if the mouse has scrolled to the right.
 
const float getScrollIndex () const
 Function in charge of returning the scroll index of the mouse.
 
const MouseWheel getScrollDirection () const
 Function in charge of returning the direction in which the user scrolled.
 
const int getPositionX () const
 Retrieves the x-coordinate of the mouse position.
 
const int getPositionY () const
 Retrieves the y-coordinate of the mouse position.
 
const std::string getInfo (const unsigned int indent=0) const
 This is a function meant for debugging purposes It will dump the current state of the variables upon call. It will dump them for itself and any of it's underlying classes.
 
void clear ()
 Resets the internal state of the MouseInfo object.
 
MouseInfooperator= (const GUI::ECS::Systems::MouseInfo &copy)
 Update the content of the class using the '=' sign overloader.
 
- Public Member Functions inherited from GUI::ECS::EntityNode
 EntityNode (const size_t entityId=0)
 
virtual ~EntityNode ()=default
 
virtual size_t getEntityNodeId () const
 

Additional Inherited Members

- Protected Attributes inherited from GUI::ECS::EntityNode
size_t _entityID
 

Detailed Description

Definition at line 40 of file MouseInfo.hpp.

Constructor & Destructor Documentation

◆ MouseInfo()

GUI::ECS::Systems::MouseInfo::MouseInfo ( const std::uint32_t entityId = 0)

Constructs a new MouseInfo object with default values.

Definition at line 19 of file MouseInfo.cpp.

◆ ~MouseInfo()

GUI::ECS::Systems::MouseInfo::~MouseInfo ( )

Destroys the MouseInfo object.

Definition at line 31 of file MouseInfo.cpp.

Member Function Documentation

◆ clear()

void GUI::ECS::Systems::MouseInfo::clear ( )

Resets the internal state of the MouseInfo object.

Definition at line 393 of file MouseInfo.cpp.

◆ getInfo()

const std::string GUI::ECS::Systems::MouseInfo::getInfo ( const unsigned int indent = 0) const

This is a function meant for debugging purposes It will dump the current state of the variables upon call. It will dump them for itself and any of it's underlying classes.

Parameters
indentThe level to which the class should be indented in the dump.
Returns
const std::string The formatted output.

Definition at line 359 of file MouseInfo.cpp.

◆ getMousePosition()

const std::pair< int, int > GUI::ECS::Systems::MouseInfo::getMousePosition ( ) const

Retrieves the current mouse position.

Returns
std::pair<int, int> The current mouse position.

Definition at line 179 of file MouseInfo.cpp.

◆ getPositionX()

const int GUI::ECS::Systems::MouseInfo::getPositionX ( ) const

Retrieves the x-coordinate of the mouse position.

Returns
int The x-coordinate of the mouse position.

Definition at line 343 of file MouseInfo.cpp.

◆ getPositionY()

const int GUI::ECS::Systems::MouseInfo::getPositionY ( ) const

Retrieves the y-coordinate of the mouse position.

Returns
int The y-coordinate of the mouse position.

Definition at line 353 of file MouseInfo.cpp.

◆ getScrollDirection()

const GUI::ECS::Systems::MouseWheel GUI::ECS::Systems::MouseInfo::getScrollDirection ( ) const

Function in charge of returning the direction in which the user scrolled.

Returns
const GUI::ECS::Systems::MouseWheel

Definition at line 329 of file MouseInfo.cpp.

◆ getScrollIndex()

const float GUI::ECS::Systems::MouseInfo::getScrollIndex ( ) const

Function in charge of returning the scroll index of the mouse.

Returns
const float

Definition at line 319 of file MouseInfo.cpp.

◆ isMouseExtra1ButtonClicked()

const bool GUI::ECS::Systems::MouseInfo::isMouseExtra1ButtonClicked ( ) const

Checks if the extra1 mouse button is pressed.

Returns
true if the extra1 button is pressed, false otherwise.

Definition at line 229 of file MouseInfo.cpp.

◆ isMouseExtra2ButtonClicked()

const bool GUI::ECS::Systems::MouseInfo::isMouseExtra2ButtonClicked ( ) const

Checks if the extra2 mouse button is pressed.

Returns
true if the extra2 button is pressed, false otherwise.

Definition at line 239 of file MouseInfo.cpp.

◆ isMouseInFocus()

const bool GUI::ECS::Systems::MouseInfo::isMouseInFocus ( ) const

Checks if the mouse is in the window.

Returns
true if the mouse is in focus, false otherwise.

Definition at line 189 of file MouseInfo.cpp.

◆ isMouseLeftButtonClicked()

const bool GUI::ECS::Systems::MouseInfo::isMouseLeftButtonClicked ( ) const

Checks if the left mouse button is pressed.

Returns
true if the left button is pressed, false otherwise.

Definition at line 199 of file MouseInfo.cpp.

◆ isMouseMiddleButtonClicked()

const bool GUI::ECS::Systems::MouseInfo::isMouseMiddleButtonClicked ( ) const

Checks if the middle mouse button is pressed.

Returns
true if the midle button is pressed, false otherwise.

Definition at line 209 of file MouseInfo.cpp.

◆ isMouseRightButtonClicked()

const bool GUI::ECS::Systems::MouseInfo::isMouseRightButtonClicked ( ) const

Checks if the right mouse button is pressed.

Returns
true if the right button is pressed, false otherwise.

Definition at line 219 of file MouseInfo.cpp.

◆ isMouseWheelScrolled()

const bool GUI::ECS::Systems::MouseInfo::isMouseWheelScrolled ( ) const

Check if the mouse has scrolled.

Returns
true it has scrolled
false it has not scrolled

Definition at line 250 of file MouseInfo.cpp.

◆ isMouseWheelScrolledDown()

const bool GUI::ECS::Systems::MouseInfo::isMouseWheelScrolledDown ( ) const

Check if the mouse has scrolled downwards.

Returns
true it has scrolled downwards
false it has scrolled in another direction

Definition at line 278 of file MouseInfo.cpp.

◆ isMouseWheelScrolledLeft()

const bool GUI::ECS::Systems::MouseInfo::isMouseWheelScrolledLeft ( ) const

Check if the mouse has scrolled to the left.

Returns
true it has scrolled to the left
false it has scrolled in another direction

Definition at line 292 of file MouseInfo.cpp.

◆ isMouseWheelScrolledRight()

const bool GUI::ECS::Systems::MouseInfo::isMouseWheelScrolledRight ( ) const

Check if the mouse has scrolled to the right.

Returns
true it has scrolled to the right
false it has scrolled in another direction

Definition at line 306 of file MouseInfo.cpp.

◆ isMouseWheelScrolledUp()

const bool GUI::ECS::Systems::MouseInfo::isMouseWheelScrolledUp ( ) const

Check if the mouse has scrolled upwards.

Returns
true it has scrolled upwards
false it has scrolled in another direction

Definition at line 264 of file MouseInfo.cpp.

◆ operator=()

GUI::ECS::Systems::MouseInfo & GUI::ECS::Systems::MouseInfo::operator= ( const GUI::ECS::Systems::MouseInfo & copy)

Update the content of the class using the '=' sign overloader.

Parameters
copy
Returns
GUI::ECS::Systems::MouseInfo&

Definition at line 416 of file MouseInfo.cpp.

◆ update() [1/3]

void GUI::ECS::Systems::MouseInfo::update ( const MouseInfo & entity)

Update the values of the class with the content of another class.

Parameters
entity

Definition at line 144 of file MouseInfo.cpp.

◆ update() [2/3]

void GUI::ECS::Systems::MouseInfo::update ( const std::any & eventCapsule)

Processes and updates the internal state based on a given sf::Event.

Parameters
eventThe SFML event to process.

Definition at line 38 of file MouseInfo.cpp.

◆ update() [3/3]

void GUI::ECS::Systems::MouseInfo::update ( const std::pair< int, int > & mousePosition)

Updates the mouse position using an integer-based vector.

Parameters
mousePositionThe new mouse position as an std::pair<int, int>.

Definition at line 167 of file MouseInfo.cpp.


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