C#
133
Вклад в тег
class Rectangle {
readonly x: number
readonly y: number
readonly w: number
readonly h: number
constructor(x: number, y: number, w: number, h: number) {
this.x = x
this.y = y
this.w = w
this.h = h
}
}
class Canvas {
private w: number
private h: number
constructor(w: number, h: number) {
this.w = w;
this.h = h;
}
public drawRect(rect: Rectangle) {
//draw implementation
}
}