import { IClone } from "./IClone" ; export class Rect implements IClone { /** The x coordinate of the rectangle. */ public x : number ; /** The y coordinate of the rectangle. */ public y : number ; /** The width of the rectangle, measured from the x position. */ public width : number ; /** The height of the rectangle, measured from the y position. */ public height : number ; param x param y param width param height constructor ( x = 0 , y = 0 , width = 0 , height = 0 ) { this . x = x ; this . y = y ; this . width = width ; this . height = height ; } param x param y param width param height returns setValue ( x , y , width , height ) { this . x = x ; this . y = y ; this . width = width ; this . height = height ; return this ; } returns clone ( ) { return new Rect ( this . x , this . y , this . width , this . height ) ; } param out returns cloneTo ( out ) { out . x = this . x ; out . y = this . y ; out . width = this . width ; out . height = this . height ; return out ; } }