bridge

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 Blue

type Blue struct{}

Blue 是具體的顏色實現

func (*Blue) ApplyColor

func (b *Blue) ApplyColor() string

type Circle

type Circle struct {
	Color Color
}

Circle 是擴充的形狀抽象,持有顏色的引用

func (*Circle) Draw

func (c *Circle) Draw() string

type Color

type Color interface {
	ApplyColor() string
}

Color 定義顏色的實現接口

type Rectangle

type Rectangle struct {
	Color Color
}

Rectangle 是擴充的形狀抽象,持有顏色的引用

func (*Rectangle) Draw

func (r *Rectangle) Draw() string

type Red

type Red struct{}

Red 是具體的顏色實現

func (*Red) ApplyColor

func (r *Red) ApplyColor() string

type Shape

type Shape interface {
	Draw() string
}

Shape 定義形狀的抽象

Jump to

Keyboard shortcuts

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