composite

package
v0.0.0-...-54da96c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2025 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Circle

type Circle struct{}

Circle 是圖形的葉子節點

func (*Circle) Draw

func (c *Circle) Draw() string

type CompositeGraphic

type CompositeGraphic struct {
	// contains filtered or unexported fields
}

CompositeGraphic 是圖形的組合節點

func (*CompositeGraphic) Add

func (cg *CompositeGraphic) Add(graphic Graphic)

func (*CompositeGraphic) Draw

func (cg *CompositeGraphic) Draw() string

type Graphic

type Graphic interface {
	Draw() string
}

Graphic 定義圖形的接口

type Rectangle

type Rectangle struct{}

Rectangle 是圖形的葉子節點

func (*Rectangle) Draw

func (r *Rectangle) Draw() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL