Thread Tools Display Modes
Prev Previous Post   Next Post Next
03-23-10, 04:15 AM   #1
cormanthor
A Warpwood Thunder Caller
 
cormanthor's Avatar
AddOn Compiler - Click to view compilations
Join Date: Nov 2008
Posts: 97
if-then-else switch

I am starting to develop my own addon. At the moment, I am working through code to determine a player's role in a group based on spec/stance/etc.
One "if" statement I am using feels like it could be much better:
Code:
local _, class = UnitClass("player")
if class == "HUNTER" or class == "MAGE" or class == "ROGUE" or class == "WARLOCK" then
-- do pure dps code here
else
-- finish function
end
Is there a better way to make a switch?
__________________
Some days it's just not worth chewing through the restraints...
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » if-then-else switch


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off