2017-11-04 19:59:11 -04:00
|
|
|
function Pos(x,y)
|
|
|
|
{
|
|
|
|
this.x = x;
|
|
|
|
this.y = y;
|
|
|
|
|
|
|
|
this.toString = function()
|
|
|
|
{
|
|
|
|
return x+","+y;
|
|
|
|
}
|
|
|
|
|
|
|
|
this.sub = function(pos2)
|
|
|
|
{
|
|
|
|
return new Pos(this.x - pos2.x,this.y - pos2.y)
|
|
|
|
}
|
2017-11-05 00:33:04 -04:00
|
|
|
|
|
|
|
this.is_equal = function(pos2)
|
|
|
|
{
|
|
|
|
return pos2.x == this.x && pos2.y == this.y;
|
|
|
|
}
|
2017-11-04 19:59:11 -04:00
|
|
|
}
|