gun

package
v0.0.0-...-a5c2be1 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2021 License: MIT Imports: 1 Imported by: 0

README

lsp 里氏替换原则

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aug

type Aug struct {
	Rifle
}

狙击步枪

func (Aug) ZoomOut

func (a Aug) ZoomOut()

望远镜

type Gun

type Gun struct {
}

普通枪

func (Gun) Shoot

func (g Gun) Shoot()

射击

type Handgun

type Handgun struct {
	Gun
}

手枪

func (Handgun) Shoot

func (h Handgun) Shoot()

射击

type IGun

type IGun interface {
	Shoot()
}

枪的接口

type IRifle

type IRifle interface {
	IGun
	ZoomOut()
}

步枪接口

type MachineGun

type MachineGun struct {
	Gun
}

机枪

func (MachineGun) Shoot

func (m MachineGun) Shoot()

type Rifle

type Rifle struct {
	Gun
}

步枪

func (Rifle) Shoot

func (r Rifle) Shoot()

type Service

type Service struct {
}

func NewService

func NewService() *Service

type Snipper

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

狙击手

func (Snipper) KillEnemy

func (s Snipper) KillEnemy()

func (*Snipper) SetRifle

func (s *Snipper) SetRifle(gun IRifle)

type Soldier

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

士兵

func (Soldier) KillEnemy

func (s Soldier) KillEnemy()

杀敌

func (*Soldier) SetGun

func (s *Soldier) SetGun(gun IGun)

分配枪支

type ToyGun

type ToyGun struct {
}

Jump to

Keyboard shortcuts

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