tags:

views:

88

answers:

3

As you may know, the wall rect will not update since its a copy and not a reference. Is there a way for me to make a reference or pointer to r and not change this code? I suppose i could do a find/replace in the function but that something i try not to do.

//code to get wall
var r = wall.r;
//more code
r.Height += yDif;
+1  A: 

This of course requires a setter.

//code to get wall
var r = wall.r;
//more code
r.Height += yDif;
wall.r = r;
ChaosPandion
d'uh i could just set it again. Theres no if(blah) return; and its always updated. ok marked as accepted.
acidzombie24
+2  A: 

It isn't going to work, you already know why. Avoid the copy or simply store the copy back:

//more code
r.Height += yDif;
wall.r = r;
Hans Passant
A: 

Why don't you update directly the wall rect ?

//code to get wall
var r = wall.r;
//more code
wall.r.Height += yDif;
Laurent Etiemble