export class Coord { public constructor ( public x , public y ) { } static parse ( input ) { const split = input . split ( ',' ) ; return new Coord ( Number ( split [ 0 ] ) , Number ( split [ 1 ] ) ) ; } public add ( coord ) { this . x += coord . x ; this . y += coord . y ; return this ; } public sub ( coord ) { this . x -= coord . x ; this . y -= coord . y ; return this ; } public toString ( ) { return `${ this . x },${ this . y }` ; } }