Skip to content

Commit

Permalink
Added const some member function qualifiers in Controller
Browse files Browse the repository at this point in the history
  • Loading branch information
Grumbel committed Aug 25, 2014
1 parent 5066ad6 commit 8c2c897
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/control/controller.cpp
Expand Up @@ -59,19 +59,19 @@ Controller::set_control(Control control, bool value)
}

bool
Controller::hold(Control control)
Controller::hold(Control control) const
{
return controls[control];
}

bool
Controller::pressed(Control control)
Controller::pressed(Control control) const
{
return !oldControls[control] && controls[control];
}

bool
Controller::released(Control control)
Controller::released(Control control) const
{
return oldControls[control] && !controls[control];
}
Expand Down
6 changes: 3 additions & 3 deletions src/control/controller.hpp
Expand Up @@ -51,11 +51,11 @@ class Controller

void set_control(Control control, bool value);
/** returns true if the control is pressed down */
bool hold(Control control);
bool hold(Control control) const;
/** returns true if the control has just been pressed down this frame */
bool pressed(Control control);
bool pressed(Control control) const;
/** returns true if the control has just been released this frame */
bool released(Control control);
bool released(Control control) const;

virtual void reset();
virtual void update();
Expand Down

0 comments on commit 8c2c897

Please sign in to comment.