c# - Public variable of struct is not changing -


okay, i've got list<specialtile> called specialtiles specialtile struct. 1 of attributes of specialtile struct public boolean value called active i'm trying change, doesn't work reason. i'm not sure if it's relevant, list owned instance of class. here's picture when ran through debugger:

impossible?

so anyway, ran problem because tried use line of code

mgen.specialtiles[esv.editthis].active = !mgen.specialtiles[esv.editthis].active; 

but told me "active" not variable. can see won't let me modify value way:

still impossible?

so assumed i'd have modify value through method. apparently doesn't work either?

am missing list variables? , if it's not supposed modify value, why debugger list "active" false , flip true?

thanks!

this issue structs. calling list indexer mgen.specialtiles[x] returns copy of structure stored in list, method call on struct operate on copy. , since copy temporary, changes made method end being discarded.

if change specialdata class should resolve issue.


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -