Peoplemon  0.1.0
Peoplemon 3 game source documentation
Public Member Functions | List of all members
core::system::hud::QtyEntry Class Reference

Helper class to render a number selector. More...

#include <QtyEntry.hpp>

Public Member Functions

 QtyEntry (bl::engine::Engine &engine)
 Construct a new quantity entry helper. More...
 
void setPosition (const sf::Vector2f &position)
 Sets the position of the selector. More...
 
sf::Vector2f getSize () const
 Returns the size of the entry in pixels. More...
 
void configure (int minQty, int maxQty, int qty)
 Configures the entry with the given parameters and adds to the overlay. More...
 
int curQty () const
 Returns the currently selected qty. More...
 
void up (int q, bool ignoreDebounce)
 Increments the qty up. More...
 
void down (int q, bool ignoreDebounce)
 Decrements the qty down. More...
 
void hide ()
 Removes the quantity entry from the overlay. More...
 

Detailed Description

Helper class to render a number selector.

Definition at line 18 of file QtyEntry.hpp.

Constructor & Destructor Documentation

◆ QtyEntry()

core::system::hud::QtyEntry::QtyEntry ( bl::engine::Engine &  engine)

Construct a new quantity entry helper.

Parameters
engineThe game engine instance

Definition at line 16 of file QtyEntry.cpp.

Member Function Documentation

◆ configure()

void core::system::hud::QtyEntry::configure ( int  minQty,
int  maxQty,
int  qty 
)

Configures the entry with the given parameters and adds to the overlay.

Parameters
minQtyThe minimum number to allow entering
maxQtyThe maximum number to allow entering
qtyThe number to start with

Definition at line 69 of file QtyEntry.cpp.

◆ curQty()

int core::system::hud::QtyEntry::curQty ( ) const

Returns the currently selected qty.

Definition at line 103 of file QtyEntry.cpp.

◆ down()

void core::system::hud::QtyEntry::down ( int  q,
bool  ignoreDebounce 
)

Decrements the qty down.

Parameters
qThe amount to go down by
ignoreDebounceTrue to always modify, false to rate limit

Definition at line 112 of file QtyEntry.cpp.

◆ getSize()

sf::Vector2f core::system::hud::QtyEntry::getSize ( ) const

Returns the size of the entry in pixels.

Definition at line 67 of file QtyEntry.cpp.

◆ hide()

void core::system::hud::QtyEntry::hide ( )

Removes the quantity entry from the overlay.

Definition at line 53 of file QtyEntry.cpp.

◆ setPosition()

void core::system::hud::QtyEntry::setPosition ( const sf::Vector2f &  position)

Sets the position of the selector.

Parameters
positionThe position to set

Definition at line 60 of file QtyEntry.cpp.

◆ up()

void core::system::hud::QtyEntry::up ( int  q,
bool  ignoreDebounce 
)

Increments the qty up.

Parameters
qThe amount to go up by
ignoreDebounceTrue to always modify, false to rate limit

Definition at line 105 of file QtyEntry.cpp.


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