信号机更好

This commit is contained in:
fan 2023-06-09 16:53:06 +08:00
parent 653d312a61
commit b79535cb83

View File

@ -5,7 +5,7 @@ import {
JlGraphicTemplate,
VectorText,
} from 'src/jl-graphic';
import { LampBody } from './LampBody';
import { LampMainBody } from './LampMainBody';
import { drawArrow } from '../CommonGraphics';
export interface ISignalData extends GraphicData {
@ -35,7 +35,7 @@ export class Signal extends JlGraphic {
codeGraph: VectorText = new VectorText('');
humanControl: Graphics = new Graphics();
fleetMode: Graphics = new Graphics();
lampBody: LampBody = new LampBody();
lampMainBody: LampMainBody = new LampMainBody();
constructor() {
super(Signal.Type);
@ -43,7 +43,7 @@ export class Signal extends JlGraphic {
this.addChild(this.codeGraph);
this.addChild(this.humanControl);
this.addChild(this.fleetMode);
this.addChild(this.lampBody);
this.addChild(this.lampMainBody);
}
get datas(): ISignalData {
@ -51,7 +51,7 @@ export class Signal extends JlGraphic {
}
paint(): void {
this.lampBody.paint(signalConsts.lampNum);
this.lampMainBody.paint(signalConsts.lampNum);
this.humanControl.beginFill(SignalColorEnum.humanControlColor, 1);
if (this.humanControl.drawRegularPolygon) {
this.humanControl.drawRegularPolygon(-10, 0, 10, 3, Math.PI / 2);
@ -60,7 +60,7 @@ export class Signal extends JlGraphic {
this.fleetMode.beginFill(SignalColorEnum.fleetModeColor, 1);
drawArrow(
this.fleetMode,
this.lampBody.width + signalConsts.fleetModeLength,
this.lampMainBody.width + signalConsts.fleetModeLength,
0,
signalConsts.fleetModeLength,
signalConsts.fleetModeRadius,