- Learn Data Structures and Algorithms with Golang
- Bhagvan Kommadi
- 69字
- 2021-06-24 15:37:31
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
}