summaryrefslogtreecommitdiff
path: root/src/item.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/item.cpp')
-rw-r--r--src/item.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/item.cpp b/src/item.cpp
index 6b13dd1b..7a8ccf6d 100644
--- a/src/item.cpp
+++ b/src/item.cpp
@@ -22,6 +22,7 @@
#include "item.h"
#include "configuration.h"
+#include "event.h"
#include "resources/image.h"
#include "resources/iteminfo.h"
@@ -73,3 +74,18 @@ void Item::setId(int id)
paths.getValue("unknownItemFile",
"unknown-item.png"));
}
+
+void Item::doEvent(const std::string &eventName)
+{
+ Mana::Event event(eventName);
+ event.setItem("item", this);
+ event.trigger("Item");
+}
+
+void Item::doEvent(const std::string &eventName, int amount)
+{
+ Mana::Event event(eventName);
+ event.setItem("item", this);
+ event.setInt("amount", amount);
+ event.trigger("Item");
+}