import { Vector } from './vector' ; import { IRect } from '../../interfaces' ; /**
 * Creates a rect vector
 */ export class Rect extends Vector < Rect , IRect > { param point param size constructor ( point , size ) { super ( 'rect' ) ; this . setPoint ( point ) ; this . setSize ( size ) ; } param point private setPoint ( point ) { if ( Array . isArray ( point ) ) { this . content . x = point [ 0 ] ; this . content . y = point [ 1 ] ; } else { this . content . x = point ; this . content . y = point ; } } param size private setSize ( size ) { if ( Array . isArray ( size ) ) { this . content . w = size [ 0 ] ; this . content . h = size [ 1 ] ; } else { this . content . w = size ; this . content . h = size ; } } param num public round ( num ) { this . content . r = num ; return this ; } }