View Single Post
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