state_pattern

package
v0.0.0-...-a5c3942 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 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 GreenState

type GreenState struct {
}

GreenState 绿灯状态及方法实现

type RedState

type RedState struct {
}

RedState 红灯状态及方法实现

type State

type State interface {
	// contains filtered or unexported methods
}

State 接口定义了3个标准方法 注意每个方法的参数是交通灯TrafficLight

type TrafficLight

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

TrafficLight 交通信号灯

func NewTrafficLight

func NewTrafficLight() *TrafficLight

type YellowState

type YellowState struct {
}

YellowState 黄灯状态及方法实现

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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