diff options
author | Chuck Miller <shadowmil@gmail.com> | 2010-11-11 23:12:29 -0500 |
---|---|---|
committer | Chuck Miller <shadowmil@gmail.com> | 2010-11-11 23:12:29 -0500 |
commit | a4640305fd0d88c6332112712aa69e496368e01b (patch) | |
tree | 0f039b331026ca2b9718a920b24e2344f9e56b25 /src/playerinfo.cpp | |
parent | 5727a2d9eeb0688a16e5b7fe32f6d9836c4f7a4e (diff) | |
download | mana-a4640305fd0d88c6332112712aa69e496368e01b.tar.gz mana-a4640305fd0d88c6332112712aa69e496368e01b.tar.bz2 mana-a4640305fd0d88c6332112712aa69e496368e01b.tar.xz mana-a4640305fd0d88c6332112712aa69e496368e01b.zip |
Replace Event names with enums instead of strings
Diffstat (limited to 'src/playerinfo.cpp')
-rw-r--r-- | src/playerinfo.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/playerinfo.cpp b/src/playerinfo.cpp index 8757053c..a8e2bebb 100644 --- a/src/playerinfo.cpp +++ b/src/playerinfo.cpp @@ -58,7 +58,7 @@ int mLevelProgress = 0; void triggerAttr(int id, int old) { - Mana::Event event("UpdateAttribute"); + Mana::Event event(EVENT_UPDATEATTRIBUTE); event.setInt("id", id); event.setInt("oldValue", old); event.setInt("newValue", mData.mAttributes.find(id)->second); @@ -68,7 +68,7 @@ void triggerAttr(int id, int old) void triggerStat(int id, const std::string &changed, int old1, int old2 = 0) { StatMap::iterator it = mData.mStats.find(id); - Mana::Event event("UpdateStat"); + Mana::Event event(EVENT_UPDATESTAT); event.setInt("id", id); event.setInt("base", it->second.base); event.setInt("mod", it->second.mod); @@ -216,7 +216,7 @@ void setStorageCount(int count) if (count != old) { - Mana::Event event("StorageCount"); + Mana::Event event(EVENT_STORAGECOUNT); event.setInt("oldCount", old); event.setInt("newCount", count); event.trigger(CHANNEL_STORAGE); @@ -237,7 +237,7 @@ void setNPCInteractionCount(int count) if (count != old) { - Mana::Event event("NPCCount"); + Mana::Event event(EVENT_NPCCOUNT); event.setInt("oldCount", old); event.setInt("newCount", count); event.trigger(CHANNEL_NPC); @@ -256,7 +256,7 @@ void setNPCPostCount(int count) if (count != old) { - Mana::Event event("PostCount"); + Mana::Event event(EVENT_POSTCOUNT); event.setInt("oldCount", old); event.setInt("newCount", count); event.trigger(CHANNEL_NPC); @@ -277,7 +277,7 @@ void setBuySellState(BuySellState buySellState) if (buySellState != old) { - Mana::Event event("StateChange"); + Mana::Event event(EVENT_STATECHANGE); event.setInt("oldState", old); event.setInt("newState", buySellState); event.trigger(CHANNEL_BUYSELL); @@ -296,7 +296,7 @@ void setTrading(bool trading) if (notify) { - Mana::Event event("Trading"); + Mana::Event event(EVENT_TRADING); event.setBool("trading", trading); event.trigger(CHANNEL_STATUS); } @@ -362,7 +362,7 @@ public: { if (channel == CHANNEL_CLIENT) { - if (event.getName() == "StateChange") + if (event.getName() == EVENT_STATECHANGE) { int newState = event.getInt("newState"); @@ -378,7 +378,7 @@ public: } else if (channel == CHANNEL_GAME) { - if (event.getName() == "Destructed") + if (event.getName() == EVENT_DESTRUCTED) { delete mInventory; delete mEquipment; |