From 870a8f4b093a8b8de20ab5e2a8fa51a27f660194 Mon Sep 17 00:00:00 2001 From: xzb <223@qq.com> Date: Thu, 16 Nov 2023 17:21:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=A1=E5=8F=B7=E6=9C=BA=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E6=9E=9A=E4=B8=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entity/signal.go | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/entity/signal.go b/entity/signal.go index 8ac6d80..a49445f 100644 --- a/entity/signal.go +++ b/entity/signal.go @@ -82,20 +82,36 @@ func newSignalLights(w ecs.World, lightTags ...component.DsTag) *component.Signa return &component.SignalLights{Lights: NewLights(w, lightTags...)} } +/* + enum Model{ + HL = 0; //2XH-1 红绿 + HLU_FU = 1; //2XH-1 红绿黄,封黄灯,无引导 + HLU_DU_YY = 2; //3XH-1 红绿黄,不封灯,有单黄,带引导 + HLU_YY = 3; //3XH-2或JDXH 红绿黄,不封灯,无单黄,带引导 + HLU_FL_DU_YY = 4;//3XH-3 红绿黄,封绿灯,有单黄,带引导 + HLU_DU = 5; //3XH-4 红绿黄,不封灯,有单黄,无引导 + AB = 6; //DXCH 蓝白 + HBU_DU = 7; //JCKXH 红白黄,不封灯,有单黄,无引导 + } +*/ // 新建灯位列表 func newSignalLightsByModel(w ecs.World, sigMt proto.Signal_Model) *component.SignalLights { switch sigMt { - case proto.Signal_HLU: - return newSignalLights(w, component.HdTag, component.LdTag, component.UdTag) case proto.Signal_HL: return newSignalLights(w, component.HdTag, component.LdTag) case proto.Signal_HLU_FU: return &component.SignalLights{Lights: []*ecs.Entry{NewLight(w, component.HdTag), NewLight(w, component.LdTag), NewLight(w, component.UdTag, component.FdTag)}} - case proto.Signal_HLU_FL: + case proto.Signal_HLU_FL_DU_YY: return &component.SignalLights{Lights: []*ecs.Entry{NewLight(w, component.HdTag), NewLight(w, component.LdTag, component.FdTag), NewLight(w, component.UdTag)}} + case proto.Signal_HLU_DU_YY: + fallthrough + case proto.Signal_HLU_YY: + fallthrough + case proto.Signal_HLU_DU: + return newSignalLights(w, component.HdTag, component.LdTag, component.UdTag) case proto.Signal_AB: return newSignalLights(w, component.AdTag, component.BdTag) - case proto.Signal_HBU: + case proto.Signal_HBU_DU: return newSignalLights(w, component.HdTag, component.BdTag, component.UdTag) default: panic(fmt.Sprintf("根据信号机模型来创建灯位列表,暂不支持该信号机模型[%d]", sigMt))