![Learn Data Structures and Algorithms with Golang](https://wfqqreader-1252317822.image.myqcloud.com/cover/744/36698744/b_36698744.jpg)
上QQ阅读APP看书,第一时间看更新
drawShape method
The drawShape method draws the shape given the coordinates, as shown in the following code:
// DrawShape struct has method draw Shape with float x and y coordinates
func (drawShape DrawShape) drawShape(x[5] float32, y[5] float32) {
fmt.Println("Drawing Shape")
}
//IContour interace
type IContour interface {
drawContour(x[5] float32 ,y[5] float32)
resizeByFactor(factor int)
}
//DrawContour struct
type DrawContour struct {
x[5] float32
y[5] float32
shape DrawShape
factor int
}