diff options
author | Jared Adams <jaxad0127@gmail.com> | 2010-08-15 21:28:10 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2010-08-16 13:19:09 -0600 |
commit | d8d9232a67a03548b827bdb0515fe7a620a488f8 (patch) | |
tree | d6e0644f99e0ff89f9b320c0b479ba5a4e398125 /src/item.cpp | |
parent | a6c2b90c2dabac18ad8052d948bc540406b3a613 (diff) | |
download | mana-d8d9232a67a03548b827bdb0515fe7a620a488f8.tar.gz mana-d8d9232a67a03548b827bdb0515fe7a620a488f8.tar.bz2 mana-d8d9232a67a03548b827bdb0515fe7a620a488f8.tar.xz mana-d8d9232a67a03548b827bdb0515fe7a620a488f8.zip |
Move more to the event system
Most of Net::InventoryHandler is now done through events. The
ActorSpriteManager was also replaced by events. A few odds and
ends were taken care of too.
Reviewed-by: Bertram
Diffstat (limited to 'src/item.cpp')
-rw-r--r-- | src/item.cpp | 16 |
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"); +} |