actualCombat

package
v0.0.0-...-05962f3 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Circle

type Circle struct {
	Radius float32
}

圆形

func (*Circle) Accept

func (c *Circle) Accept(v Visitor)

func (*Circle) GetType

func (c *Circle) GetType() string

type MiddleCoordinates

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

中点坐标计算器

func (*MiddleCoordinates) VisitForCircle

func (a *MiddleCoordinates) VisitForCircle(c *Circle)

func (*MiddleCoordinates) VisitForRectangle

func (a *MiddleCoordinates) VisitForRectangle(t *Rectangle)

func (*MiddleCoordinates) VisitForSquare

func (a *MiddleCoordinates) VisitForSquare(s *Square)

type PerimeterCalculator

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

具体访问者——周长计算器

func (*PerimeterCalculator) VisitForCircle

func (a *PerimeterCalculator) VisitForCircle(c *Circle)

func (*PerimeterCalculator) VisitForRectangle

func (a *PerimeterCalculator) VisitForRectangle(r *Rectangle)

func (*PerimeterCalculator) VisitForSquare

func (a *PerimeterCalculator) VisitForSquare(s *Square)

type Rectangle

type Rectangle struct {
	L float32
	B float32
}

矩形

func (*Rectangle) Accept

func (t *Rectangle) Accept(v Visitor)

func (*Rectangle) GetType

func (t *Rectangle) GetType() string

type Shape

type Shape interface {
	GetType() string
	Accept(Visitor)
}

形状接口

type Square

type Square struct {
	Side float32
}

具体元素——正方形

func (*Square) Accept

func (s *Square) Accept(v Visitor)

func (*Square) GetType

func (s *Square) GetType() string

type Visitor

type Visitor interface {
	VisitForSquare(*Square)
	VisitForCircle(*Circle)
	VisitForRectangle(*Rectangle)
}

访问者接口

Jump to

Keyboard shortcuts

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