summaryrefslogtreecommitdiff
path: root/src/listeners/arrowslistener.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-04-27 19:03:49 +0300
committerAndrei Karas <akaras@inbox.ru>2014-04-27 19:03:49 +0300
commitc77f06f7b80a67c842abe837beb2f22e9ecf60cc (patch)
tree65da775f4830fde8ccbf7a6d7514e42169321486 /src/listeners/arrowslistener.cpp
parent8836d01c806f7d7e99befb5036148e8ff7b0e24e (diff)
downloadplus-c77f06f7b80a67c842abe837beb2f22e9ecf60cc.tar.gz
plus-c77f06f7b80a67c842abe837beb2f22e9ecf60cc.tar.bz2
plus-c77f06f7b80a67c842abe837beb2f22e9ecf60cc.tar.xz
plus-c77f06f7b80a67c842abe837beb2f22e9ecf60cc.zip
Add ArrowsListener.
Also fix arrows amount update on arrows pickup.
Diffstat (limited to 'src/listeners/arrowslistener.cpp')
-rw-r--r--src/listeners/arrowslistener.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/listeners/arrowslistener.cpp b/src/listeners/arrowslistener.cpp
new file mode 100644
index 000000000..d9d7b0006
--- /dev/null
+++ b/src/listeners/arrowslistener.cpp
@@ -0,0 +1,36 @@
+/*
+ * The ManaPlus Client
+ * Copyright (C) 2014 The ManaPlus Developers
+ *
+ * This file is part of The ManaPlus Client.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "listeners/arrowslistener.h"
+
+#include "debug.h"
+
+defineListener(ArrowsListener)
+
+void ArrowsListener::distributeEvent()
+{
+ FOR_EACH (std::vector<ArrowsListener*>::iterator,
+ it, mListeners)
+ {
+ ArrowsListener *const listener = *it;
+ if (listener)
+ listener->arrowsChanged();
+ }
+}