Learn Data Structures and Algorithms with Golang
上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
}