Peoplemon  0.1.0
Peoplemon 3 game source documentation
Public Member Functions | Static Public Member Functions | List of all members
game::menu::StorageCursor Class Reference

Cursor that is used to navigate the storage system boxes. More...

#include <StorageCursor.hpp>

Public Member Functions

 StorageCursor (bl::engine::Engine &engine)
 Construct a new Storage Cursor. More...
 
void activate (bl::ecs::Entity parent)
 Adds to the current overlay. More...
 
void deactivate ()
 Removes from the current scene. More...
 
void setHidden (bool hide)
 Show or hide the cursor. More...
 
void update (float dt)
 Updates the cursor motion. More...
 
bool process (core::input::EntityControl cmd, bool skipAnim)
 Processes user input to move the cursor. More...
 
void setHolding (core::pplmn::Id peoplemon)
 Sets a Peoplemon to render with the cursor. Pass Unknown to clear. More...
 
bool moving () const
 Returns whether or not the cursor position is being interpolated. More...
 
const sf::Vector2i & getPosition () const
 Returns the position of the cursor in the box. More...
 
void setX (int x)
 Sets the x position of the cursor. More...
 
void pageLeft ()
 Updates the cursor position if the box to the left is switched to. More...
 
void pageRight ()
 Updates the cursor position if the box to the right is switched to. More...
 

Static Public Member Functions

static float TileSize ()
 Returns the size of a square on the grid. More...
 

Detailed Description

Cursor that is used to navigate the storage system boxes.

Definition at line 19 of file StorageCursor.hpp.

Constructor & Destructor Documentation

◆ StorageCursor()

game::menu::StorageCursor::StorageCursor ( bl::engine::Engine &  engine)

Construct a new Storage Cursor.

Parameters
engineThe game engine instance

Definition at line 38 of file StorageCursor.cpp.

Member Function Documentation

◆ activate()

void game::menu::StorageCursor::activate ( bl::ecs::Entity  parent)

Adds to the current overlay.

Parameters
parentThe parent entity for correct render order

Definition at line 53 of file StorageCursor.cpp.

◆ deactivate()

void game::menu::StorageCursor::deactivate ( )

Removes from the current scene.

Definition at line 68 of file StorageCursor.cpp.

◆ getPosition()

const sf::Vector2i & game::menu::StorageCursor::getPosition ( ) const

Returns the position of the cursor in the box.

Definition at line 182 of file StorageCursor.cpp.

◆ moving()

bool game::menu::StorageCursor::moving ( ) const

Returns whether or not the cursor position is being interpolated.

Definition at line 180 of file StorageCursor.cpp.

◆ pageLeft()

void game::menu::StorageCursor::pageLeft ( )

Updates the cursor position if the box to the left is switched to.

Definition at line 189 of file StorageCursor.cpp.

◆ pageRight()

void game::menu::StorageCursor::pageRight ( )

Updates the cursor position if the box to the right is switched to.

Definition at line 194 of file StorageCursor.cpp.

◆ process()

bool game::menu::StorageCursor::process ( core::input::EntityControl  cmd,
bool  skipAnim 
)

Processes user input to move the cursor.

Parameters
cmdThe user input
skipAnimTrue to skip the rest of an in-progress animation and move right away
Returns
True if the cursor moved, false otherwise

Definition at line 105 of file StorageCursor.cpp.

◆ setHidden()

void game::menu::StorageCursor::setHidden ( bool  hide)

Show or hide the cursor.

Parameters
hideTrue to hide, false to show

Definition at line 74 of file StorageCursor.cpp.

◆ setHolding()

void game::menu::StorageCursor::setHolding ( core::pplmn::Id  peoplemon)

Sets a Peoplemon to render with the cursor. Pass Unknown to clear.

Parameters
peoplemonThe peoplemon thumbnail to hold

Definition at line 150 of file StorageCursor.cpp.

◆ setX()

void game::menu::StorageCursor::setX ( int  x)

Sets the x position of the cursor.

Parameters
xThe new x position

Definition at line 184 of file StorageCursor.cpp.

◆ TileSize()

float game::menu::StorageCursor::TileSize ( )
static

Returns the size of a square on the grid.

Definition at line 205 of file StorageCursor.cpp.

◆ update()

void game::menu::StorageCursor::update ( float  dt)

Updates the cursor motion.

Parameters
dtTime elapsed in seconds

Definition at line 84 of file StorageCursor.cpp.


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