53 lines
1.3 KiB
Go
53 lines
1.3 KiB
Go
package component
|
|
|
|
import (
|
|
"joylink.club/ecs"
|
|
"joylink.club/rtsssimulation/consts"
|
|
)
|
|
|
|
// AfcGate AFC闸机
|
|
type AfcGate struct {
|
|
State AgsState //闸机状态
|
|
Exception consts.DeviceExceptionEnum //具体异常-故障、异常、通信中断
|
|
}
|
|
|
|
// AgsState AFC闸机状态定义
|
|
type AgsState = uint8
|
|
|
|
const (
|
|
AgsNormal AgsState = iota //正常
|
|
AgsOutService //闸机未开放
|
|
)
|
|
|
|
//////////////////////////////////////////
|
|
|
|
// TicketMachine 票机(自动售票机、半自动售票机、验票机)
|
|
type TicketMachine struct {
|
|
State TmState //票机状态
|
|
Exception consts.DeviceExceptionEnum //具体异常-故障、通信中断
|
|
}
|
|
|
|
// TmState 票机状态定义
|
|
type TmState = uint8
|
|
|
|
const (
|
|
TmNormal TmState = iota //正常
|
|
TmOutService //暂停服务
|
|
)
|
|
|
|
//////////////////////////////////////////////////////
|
|
|
|
var (
|
|
AfcGateType = ecs.NewComponentType[AfcGate]()
|
|
|
|
EntranceGateTag = ecs.NewTag() //进闸机
|
|
ExitGateTag = ecs.NewTag() //出闸机
|
|
TwoWayGateTag = ecs.NewTag() //双向闸机
|
|
|
|
TicketMachineType = ecs.NewComponentType[TicketMachine]()
|
|
|
|
TicketVendingMachineTag = ecs.NewTag() //自动售票机
|
|
SemiAutoTicketMachineTag = ecs.NewTag() //半自动售票机
|
|
TicketCheckingMachineTag = ecs.NewTag() //验票机
|
|
)
|