function AIORotation:SetRotation(val)
if val == "abcd" then
self.db.profile.activeRotation = AIORotation.aaaa:new()
elseif val == "dddd" then
self.db.profile.activeRotation = AIORotation.dddd:new()
end
end
I am passing a string into this function and want to call a function based off the string name. Is something like this possible without a bunch of if statements?
So ideally, it would be something like this
function AIORotation:SetRotation(val)
self.db.profile.activeRotation = AIORotation.<INSERT_VAL_HERE>:new()
end
But I'm not sure if something like this is possible in lua.