summaryrefslogtreecommitdiff
path: root/src/input/inputactionoperators.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-05-31 00:24:33 +0300
committerAndrei Karas <akaras@inbox.ru>2015-05-31 00:53:27 +0300
commit33777ea0994f01c696b74677f4937fe2987552c9 (patch)
treedaf075a6dc57597301b0441a8d4e485ad80daedf /src/input/inputactionoperators.cpp
parent694e07d193e7c5758a7d672b45668651b034003d (diff)
downloadplus-33777ea0994f01c696b74677f4937fe2987552c9.tar.gz
plus-33777ea0994f01c696b74677f4937fe2987552c9.tar.bz2
plus-33777ea0994f01c696b74677f4937fe2987552c9.tar.xz
plus-33777ea0994f01c696b74677f4937fe2987552c9.zip
Add opearator+ for InputAction and unsigned int.
Signed-off-by: Andrei Karas <akaras@inbox.ru>
Diffstat (limited to 'src/input/inputactionoperators.cpp')
-rw-r--r--src/input/inputactionoperators.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/input/inputactionoperators.cpp b/src/input/inputactionoperators.cpp
index a2c0eb496..ef0c48d69 100644
--- a/src/input/inputactionoperators.cpp
+++ b/src/input/inputactionoperators.cpp
@@ -26,6 +26,12 @@ InputActionT operator+(InputActionT action, const int& i)
return action;
}
+InputActionT operator+(InputActionT action, const unsigned int& i)
+{
+ action = static_cast<InputActionT>(static_cast<unsigned int>(action) + i);
+ return action;
+}
+
int operator-(const InputActionT &action1, const InputActionT &action2)
{
return static_cast<int>(action1) - static_cast<int>(action2);