main
position p1 = 0, 0
position p2 = -10, 50
position p3 = 680, 1245
Position represents a coordinate in 2 dimensional x/y space. The values of x and y may be any integers.
main
position p1 = 0, 0
position p2 = -10, 50
position p3 = 680, 1245
Creates a new position that is an exact copy of sourcePositionn.
main
position p1 = 0, 0
position p2 = p1.copy // p2 == 0,0
Creates a new position with the given x and y values.
main
position p = 120, 360 // p == 120, 360
Comparision
main
position p1 = 120, 360
position p2 = 360, 120
bool samePosition = p1 == p2 // samePosition == false
Comparision
main
position p1 = 120, 360
position p2 = 360, 120
bool samePosition = p1 != p2 // samePosition == true
Get the value of the x-coordinate.
main
position p = 120, 360
int x = p.get x // x == 120
Get the value of the y-coordinate.
main
position p = 120, 360
int y = p.get y // x == 360
Assing a new value for the x-coordinate.
main
position p = 120, 360
p.set x to 360 // p == 360, 360
Assing a new value for the y-coordinate.
main
position p = 120, 360
p.set y to 120 // p == 120, 120