Skip to content

Commit d3e23b8

Browse files
committed
rename for clarity
1 parent 08a57f9 commit d3e23b8

File tree

4 files changed

+10
-14
lines changed

4 files changed

+10
-14
lines changed

FluffyEngine/Controller.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ namespace Fluffy
5151
return m_ReleasedButtons & button;
5252
}
5353

54-
bool Controller::IsPrevious(unsigned int button)
54+
bool Controller::IsHeld(unsigned int button)
5555
{
5656
return m_PreviousButtons & button;
5757
}
@@ -62,9 +62,9 @@ namespace Fluffy
6262
{
6363
switch (binding.first.inputState)
6464
{
65-
case InputState::Previous:
65+
case InputState::Held:
6666
{
67-
if (IsPrevious(unsigned int(binding.first.button)))
67+
if (IsHeld(unsigned int(binding.first.button)))
6868
{
6969
binding.second->Execute();
7070
}

FluffyEngine/Controller.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ namespace Fluffy
6363

6464
bool IsPressed(unsigned int button) override;
6565
bool IsReleased(unsigned int button) override;
66-
bool IsPrevious(unsigned int button) override;
66+
bool IsHeld(unsigned int button) override;
6767

6868
void HandleInput() override;
6969

FluffyEngine/Keyboard.cpp

+5-9
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include "Command.h"
33
#include <functional>
44
#include <algorithm>
5+
#include <iostream>
56

67
namespace Fluffy
78
{
@@ -39,7 +40,7 @@ namespace Fluffy
3940
return m_ReleasedKeys[key];
4041
}
4142

42-
bool Keyboard::IsPrevious(unsigned int key)
43+
bool Keyboard::IsHeld(unsigned int key)
4344
{
4445
return m_PreviousKeys[key];
4546
}
@@ -50,30 +51,25 @@ namespace Fluffy
5051
{
5152
switch (binding.first.inputState)
5253
{
53-
case InputState::Previous:
54+
case InputState::Held:
5455
{
55-
if (IsPrevious(binding.first.key))
56-
{
56+
if (IsHeld(binding.first.key))
5757
binding.second->Execute();
58-
}
5958

6059
break;
6160
}
6261
case InputState::Pressed:
6362
{
6463
if (IsPressed(binding.first.key))
65-
{
6664
binding.second->Execute();
67-
}
6865

6966
break;
7067
}
7168
case InputState::Released:
7269
{
7370
if (IsReleased(binding.first.key))
74-
{
7571
binding.second->Execute();
76-
}
72+
7773
break;
7874
}
7975
}

FluffyEngine/Keyboard.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ namespace Fluffy
5454

5555
bool IsPressed(unsigned int key) override;
5656
bool IsReleased(unsigned int key) override;
57-
bool IsPrevious(unsigned int key) override;
57+
bool IsHeld(unsigned int key) override;
5858

5959
void HandleInput() override;
6060

0 commit comments

Comments
 (0)