View Single Post
JoshGomez
Member
Join Date: Apr 2006
Location: Sweden
Old 12-06-2022 , 07:30   Re: Enum struct, how do we access the struct property as parameter?
Reply With Quote #5

Quote:
Originally Posted by azalty View Post
index.CameraShakeChance or FPlayerChances[client][index].CameraShakeChance ?

I'm pretty confused about your code. I don't really get it, you pass an enum struct as a parameter called index (weird name) yet you access it with FPlayerChances[client][index] like wtf.
And old syntax too :'(
No, that not what I want I had an old script that was working before which I want to refactor, but I got this warning which I forgot the description of, something like index based enum was removed.
The code in the example is not the initial code as it was work in progress of the refactoring so it may be lot of confusion.

I want to access the property of the enum by flag or string using "reflection", is that possible? Otherwise, I was thinking of refactor the data structure to StringMap.

Last edited by JoshGomez; 12-06-2022 at 07:33.
JoshGomez is offline