From 5727a2d9eeb0688a16e5b7fe32f6d9836c4f7a4e Mon Sep 17 00:00:00 2001 From: Chuck Miller Date: Thu, 11 Nov 2010 21:55:25 -0500 Subject: Have the event system channels use enums instead of strings Reviewed-by: Freeyorp --- src/localplayer.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/localplayer.cpp') diff --git a/src/localplayer.cpp b/src/localplayer.cpp index b60ee6f7..a0e7184d 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -87,14 +87,14 @@ LocalPlayer::LocalPlayer(int id, int subtype): mMessageTime(0), mShowIp(false) { - listen("Attributes"); + listen(CHANNEL_ATTRIBUTES); mUpdateName = true; config.addListener("showownname", this); setShowName(config.getValue("showownname", 1)); - listen("ActorSprite"); + listen(CHANNEL_ACTORSPRITE); } LocalPlayer::~LocalPlayer() @@ -1084,9 +1084,9 @@ void LocalPlayer::optionChanged(const std::string &value) } } -void LocalPlayer::event(const std::string &channel, const Mana::Event &event) +void LocalPlayer::event(Channels channel, const Mana::Event &event) { - if (channel == "ActorSprite") + if (channel == CHANNEL_ACTORSPRITE) { if (event.getName() == "Destroyed") { @@ -1099,7 +1099,7 @@ void LocalPlayer::event(const std::string &channel, const Mana::Event &event) mTarget = 0; } } - else if (channel == "Attributes") + else if (channel == CHANNEL_ATTRIBUTES) { if (event.getName() == "UpdateAttribute") { -- cgit v1.2.3-60-g2f50