composite

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Developer

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

developer角色类

func (*Developer) DevelopProject

func (d *Developer) DevelopProject()

func (*Developer) PrintInfo

func (d *Developer) PrintInfo()

type IDeveloper

type IDeveloper interface {
	IEmployee
	DevelopProject()
}

func NewDeveloper

func NewDeveloper(name, position string, salary float32) IDeveloper

type IEmployee

type IEmployee interface {
	PrintInfo()
}

通用employee接口

type IManager

type IManager interface {
	IEmployee
	AddEmp(IEmployee)
	RemoveEmp(IEmployee)
}

角色接口

func NewManager

func NewManager(name, position string, salary float32) IManager

type Manager

type Manager struct {
	Employees []IEmployee
	// contains filtered or unexported fields
}

manager角色类

func (*Manager) AddEmp

func (m *Manager) AddEmp(emp IEmployee)

func (*Manager) PrintInfo

func (m *Manager) PrintInfo()

func (*Manager) RemoveEmp

func (m *Manager) RemoveEmp(emp IEmployee)

Jump to

Keyboard shortcuts

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