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 FreightTrain

type FreightTrain struct {
	Mediator Mediator
}

货运列车类

func (*FreightTrain) Arrive

func (g *FreightTrain) Arrive()

火车到达

func (*FreightTrain) Depart

func (g *FreightTrain) Depart()

火车离开

func (*FreightTrain) PermitArrival

func (g *FreightTrain) PermitArrival()

允许到达

type Mediator

type Mediator interface {
	CanArrive(Train) bool
	NotifyAboutDeparture()
}

type PassengerTrain

type PassengerTrain struct {
	Mediator Mediator
}

客运火车类

func (*PassengerTrain) Arrive

func (p *PassengerTrain) Arrive()

火车到达

func (*PassengerTrain) Depart

func (p *PassengerTrain) Depart()

火车离开

func (*PassengerTrain) PermitArrival

func (p *PassengerTrain) PermitArrival()

允许到达

type StationManager

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

func NewStationManger

func NewStationManger() *StationManager

func (*StationManager) CanArrive

func (s *StationManager) CanArrive(t Train) bool

func (*StationManager) NotifyAboutDeparture

func (s *StationManager) NotifyAboutDeparture()

type Train

type Train interface {
	Arrive()
	Depart()
	PermitArrival()
}

Jump to

Keyboard shortcuts

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