| 26 | } |
| 27 | |
| 28 | export class Rectangle implements ISerializable{ |
| 29 | private _x:number; |
| 30 | private _y:number; |
| 31 | private _width:number; |
| 32 | private _height:number; |
| 33 | constructor(x:number = 0, |
| 34 | y:number = 0, |
| 35 | width:number = 0, |
| 36 | height:number = 0) { |
| 37 | |
| 38 | this._x = x; |
| 39 | this._y = y; |
| 40 | this._width = width; |
| 41 | this._height= height; |
| 42 | } |
| 43 | |
| 44 | public set x(v:number) { |
| 45 | if (v !== null) { |
| 46 | this._x = v; |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | public set y(v:number) { |
| 51 | if (v !== null) { |
| 52 | this._y = v; |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | public set width(v:number) { |
| 57 | if (v !== null) { |
| 58 | this._width = v; |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | public set height(v:number) { |
| 63 | if (v !== null) { |
| 64 | this._height = v; |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | public get x():number { |
| 69 | return this._x; |
| 70 | } |
| 71 | |
| 72 | public get y():number { |
| 73 | return this._y; |
| 74 | } |
| 75 | |
| 76 | public get width():number { |
| 77 | return this._width; |
| 78 | } |
| 79 | |
| 80 | public get height():number { |
| 81 | return this._height; |
| 82 | } |
| 83 | |
| 84 | public get left():number { |
| 85 | return this._x; |
nothing calls this directly
no outgoing calls
no test coverage detected