factory1

package
v0.0.0-...-9e1c66b Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Human

type Human interface {
	Eat()
	Play()
}

简单工厂的模式的话就不需要这个接口了 定义人类接口

type HumanFactoryInf

type HumanFactoryInf interface {
	Create() Human
}

type WhiteHumanFactory

type WhiteHumanFactory struct {
}

func (*WhiteHumanFactory) Create

func (factory *WhiteHumanFactory) Create() Human

type YellowHumanFactory

type YellowHumanFactory struct {
}

func (*YellowHumanFactory) Create

func (factory *YellowHumanFactory) Create() Human

Jump to

Keyboard shortcuts

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