From e855b7f85f681283a2c8ee804fb73d082d8cf623 Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Mon, 12 Jun 2023 17:53:39 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BA=BF=E7=BD=91=E5=88=97=E8=BD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/drawApp/graphics/TrainLineInteraction.ts | 38 + src/drawApp/index.ts | 21 +- src/graphics/trainLine/TrainLine.ts | 45 + src/graphics/trainLine/TrainLineAssistant.ts | 77 + src/graphics/trainLine/trainLineSprites.png | Bin 0 -> 8918 bytes src/protos/stationLayoutGraphics.ts | 5300 ++++++++---------- 6 files changed, 2633 insertions(+), 2848 deletions(-) create mode 100644 src/drawApp/graphics/TrainLineInteraction.ts create mode 100644 src/graphics/trainLine/TrainLine.ts create mode 100644 src/graphics/trainLine/TrainLineAssistant.ts create mode 100644 src/graphics/trainLine/trainLineSprites.png diff --git a/src/drawApp/graphics/TrainLineInteraction.ts b/src/drawApp/graphics/TrainLineInteraction.ts new file mode 100644 index 0000000..44e82de --- /dev/null +++ b/src/drawApp/graphics/TrainLineInteraction.ts @@ -0,0 +1,38 @@ +import * as pb_1 from 'google-protobuf'; +import { ITrainLineData } from 'src/graphics/trainLine/TrainLine'; +import { graphicData } from 'src/protos/stationLayoutGraphics'; +import { GraphicDataBase } from './GraphicDataBase'; + +export class TrainLineData extends GraphicDataBase implements ITrainLineData { + constructor(data?: graphicData.TrainLine) { + let fan; + if (data) { + fan = data; + } else { + fan = new graphicData.TrainLine({ + common: GraphicDataBase.defaultCommonInfo(), + }); + } + super(fan); + } + + public get data(): graphicData.TrainLine { + return this.getData(); + } + + get code(): string { + return this.data.code; + } + set code(v: string) { + this.data.code = v; + } + clone(): TrainLineData { + return new TrainLineData(this.data.cloneMessage()); + } + copyFrom(data: TrainLineData): void { + pb_1.Message.copyInto(data.data, this.data); + } + eq(other: TrainLineData): boolean { + return pb_1.Message.equals(this.data, other.data); + } +} diff --git a/src/drawApp/index.ts b/src/drawApp/index.ts index ca0497a..6a121dc 100644 --- a/src/drawApp/index.ts +++ b/src/drawApp/index.ts @@ -34,6 +34,9 @@ import { StationData } from './graphics/StationInteraction'; import { StationLine } from 'src/graphics/stationLine/StationLine'; import { StationLineDraw } from 'src/graphics/stationLine/StationLineDrawAssistant'; import { StationLineData } from './graphics/StationLineInteraction'; +import { TrainLine } from 'src/graphics/trainLine/TrainLine'; +import { TrainLineDraw } from 'src/graphics/trainLine/TrainLineAssistant'; +import { TrainLineData } from './graphics/TrainLineInteraction'; import { Turnout } from 'src/graphics/turnout/Turnout'; import { TurnoutDraw } from 'src/graphics/turnout/TurnoutDrawAssistant'; import { TurnoutData } from './graphics/TurnoutInteraction'; @@ -126,6 +129,7 @@ export function initDrawApp(dom: HTMLElement): JlDrawApp { | SectionDraw | StationLineDraw | RectDraw + | TrainLineDraw )[] = []; if (draftType === 'Line') { drawAssistants = [ @@ -157,13 +161,22 @@ export function initDrawApp(dom: HTMLElement): JlDrawApp { new RunLineDraw(app, () => { return new RunLineData(); }), + new TrainLineDraw(app, () => { + return new TrainLineData(); + }), ]; app.addKeyboardListener( new KeyListener({ - value: 'KeyI', + value: 'KeyO', onPress: () => { app.interactionPlugin(StationLine.Type).resume(); }, + }), + new KeyListener({ + value: 'KeyR', + onPress: () => { + app.interactionPlugin(Rect.Type).resume(); + }, }) ); } @@ -259,6 +272,9 @@ export function saveDrawDatas(app: JlDrawApp) { } else if (StationLine.Type === g.type) { const stationLineData = (g as StationLine).saveData(); storage.stationLines.push((stationLineData as StationLineData).data); + } else if (TrainLine.Type === g.type) { + const trainLineData = (g as TrainLine).saveData(); + storage.trainLines.push((trainLineData as TrainLineData).data); } }); const base64 = fromUint8Array(storage.serialize()); @@ -317,6 +333,9 @@ export async function loadDrawDatas(app: GraphicApp) { storage.stationLines.forEach((stationLine) => { datas.push(new StationLineData(stationLine)); }); + storage.trainLines.forEach((trainLine) => { + datas.push(new TrainLineData(trainLine)); + }); app.loadGraphic(datas); } else { app.loadGraphic([]); diff --git a/src/graphics/trainLine/TrainLine.ts b/src/graphics/trainLine/TrainLine.ts new file mode 100644 index 0000000..6d207e2 --- /dev/null +++ b/src/graphics/trainLine/TrainLine.ts @@ -0,0 +1,45 @@ +import { GraphicData, JlGraphic, JlGraphicTemplate } from 'src/jl-graphic'; +import trainLineSprites from './trainLineSprites.png'; + +import { Assets, Sprite, Texture } from 'pixi.js'; + +export interface ITrainLineData extends GraphicData { + get code(): string; + set code(v: string); +} + +export class TrainLine extends JlGraphic { + static Type = 'TrainLine'; + train: Sprite; + trainTextures: Texture; + + constructor(trainTextures: Texture) { + super(TrainLine.Type); + this.trainTextures = trainTextures; + this.train = new Sprite(); + this.train.texture = this.trainTextures; + this.train.anchor.set(0.5); + this.train.scale.set(0.1, 0.1); + this.addChild(this.train); + } + doRepaint(): void { + this.train.texture = this.trainTextures; + } +} + +export class ItrainLineTemplate extends JlGraphicTemplate { + trainTextures?: Texture; + constructor() { + super(TrainLine.Type); + } + new(): TrainLine { + if (this.trainTextures) { + return new TrainLine(this.trainTextures); + } + throw new Error('资源未加载/加载失败'); + } + async loadAssets(): Promise { + this.trainTextures = await Assets.load(trainLineSprites); + return this.trainTextures as Texture; + } +} diff --git a/src/graphics/trainLine/TrainLineAssistant.ts b/src/graphics/trainLine/TrainLineAssistant.ts new file mode 100644 index 0000000..aea78ab --- /dev/null +++ b/src/graphics/trainLine/TrainLineAssistant.ts @@ -0,0 +1,77 @@ +import { FederatedMouseEvent, Point } from 'pixi.js'; +import { + GraphicDrawAssistant, + GraphicInteractionPlugin, + JlDrawApp, + JlGraphic, +} from 'src/jl-graphic'; +import { ITrainLineData, TrainLine, ItrainLineTemplate } from './TrainLine'; + +export class TrainLineDraw extends GraphicDrawAssistant< + ItrainLineTemplate, + ITrainLineData +> { + train: TrainLine | null = null; + + constructor(app: JlDrawApp, createData: () => ITrainLineData) { + const template = new ItrainLineTemplate(); + super(app, template, createData, 'directions_bus_filled', '列车线网'); + ItrainLineInteraction.init(app); + } + + bind(): void { + super.bind(); + if (!this.train) { + this.train = this.graphicTemplate.new(); + this.container.addChild(this.train); + } + } + + public get trainLine(): TrainLine { + if (!this.train) { + throw new Error('列车绘制逻辑异常'); + } + return this.train; + } + + redraw(cp: Point): void { + this.trainLine.position.copyFrom(cp); + } + onLeftUp(e: FederatedMouseEvent): void { + this.trainLine.position.copyFrom(this.toCanvasCoordinates(e.global)); + this.createAndStore(false); + } + prepareData(data: ITrainLineData): boolean { + data.transform = this.trainLine.saveTransform(); + return true; + } + onEsc(): void { + this.finish(); + } +} + +export class ItrainLineInteraction extends GraphicInteractionPlugin { + static Name = 'trainLine_transform'; + constructor(app: JlDrawApp) { + super(ItrainLineInteraction.Name, app); + } + static init(app: JlDrawApp) { + return new ItrainLineInteraction(app); + } + filter(...grahpics: JlGraphic[]): TrainLine[] | undefined { + return grahpics + .filter((g) => g.type === TrainLine.Type) + .map((g) => g as TrainLine); + } + bind(g: TrainLine): void { + g.eventMode = 'static'; + g.cursor = 'pointer'; + g.scalable = true; + g.rotatable = true; + } + unbind(g: TrainLine): void { + g.eventMode = 'none'; + g.scalable = false; + g.rotatable = false; + } +} diff --git a/src/graphics/trainLine/trainLineSprites.png b/src/graphics/trainLine/trainLineSprites.png new file mode 100644 index 0000000000000000000000000000000000000000..75e8a93df77e817cc660dbcf1f50a139eb2836a7 GIT binary patch literal 8918 zcmYj%cRbtQ_kTpJQVnVCR-{Djy;rJ1?A21Eq^P~Bs9DicVw4yaTg}>=+M{;Wre^KY zK~cNPH}w7aJ%0H^;=b-Z=iGD7J>x!KSRE~ut5=w=004liswku$06>Hz{O%zqCH&?3 zGCNE7B6_B$q6jD%VEG0BKmn@AyZ61!HdB35Sf0e6rR%3s>V`rklv=ar)f97mX``Xf z>2!77J8uMs7M4J1qr*W$8V{~X^CoVA>Ua&6INpcSPwu}ATk5-M8dw(ntw2?9^d|Il zV&)7aR%9jo$VNd-khkvhUQR*7*I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nType[]; - signals?: ReturnType[]; - turnouts?: ReturnType[]; - section?: ReturnType[]; - stationLines?: ReturnType[]; - runLines?: ReturnType[]; - }): RtssGraphicStorage { - const message = new RtssGraphicStorage({}); - if (data.canvas != null) { - message.canvas = Canvas.fromObject(data.canvas); - } - if (data.links != null) { - message.links = data.links.map((item) => Link.fromObject(item)); - } - if (data.iscsFans != null) { - message.iscsFans = data.iscsFans.map((item) => - IscsFan.fromObject(item) - ); - } - if (data.Platforms != null) { - message.Platforms = data.Platforms.map((item) => - Platform.fromObject(item) - ); - } - if (data.stations != null) { - message.stations = data.stations.map((item) => - Station.fromObject(item) - ); - } - if (data.rects != null) { - message.rects = data.rects.map((item) => Rect.fromObject(item)); - } - if (data.train != null) { - message.train = data.train.map((item) => Train.fromObject(item)); - } - if (data.signals != null) { - message.signals = data.signals.map((item) => Signal.fromObject(item)); - } - if (data.turnouts != null) { - message.turnouts = data.turnouts.map((item) => - Turnout.fromObject(item) - ); - } - if (data.section != null) { - message.section = data.section.map((item) => Section.fromObject(item)); - } - if (data.stationLines != null) { - message.stationLines = data.stationLines.map((item) => - StationLine.fromObject(item) - ); - } - if (data.runLines != null) { - message.runLines = data.runLines.map((item) => - RunLine.fromObject(item) - ); - } - return message; - } - toObject() { - const data: { - canvas?: ReturnType; - links?: ReturnType[]; - iscsFans?: ReturnType[]; - Platforms?: ReturnType[]; - stations?: ReturnType[]; - rects?: ReturnType[]; - train?: ReturnType[]; - signals?: ReturnType[]; - turnouts?: ReturnType[]; - section?: ReturnType[]; - stationLines?: ReturnType[]; - runLines?: ReturnType[]; - } = {}; - if (this.canvas != null) { - data.canvas = this.canvas.toObject(); - } - if (this.links != null) { - data.links = this.links.map((item: Link) => item.toObject()); - } - if (this.iscsFans != null) { - data.iscsFans = this.iscsFans.map((item: IscsFan) => item.toObject()); - } - if (this.Platforms != null) { - data.Platforms = this.Platforms.map((item: Platform) => - item.toObject() - ); - } - if (this.stations != null) { - data.stations = this.stations.map((item: Station) => item.toObject()); - } - if (this.rects != null) { - data.rects = this.rects.map((item: Rect) => item.toObject()); - } - if (this.train != null) { - data.train = this.train.map((item: Train) => item.toObject()); - } - if (this.signals != null) { - data.signals = this.signals.map((item: Signal) => item.toObject()); - } - if (this.turnouts != null) { - data.turnouts = this.turnouts.map((item: Turnout) => item.toObject()); - } - if (this.section != null) { - data.section = this.section.map((item: Section) => item.toObject()); - } - if (this.stationLines != null) { - data.stationLines = this.stationLines.map((item: StationLine) => - item.toObject() - ); - } - if (this.runLines != null) { - data.runLines = this.runLines.map((item: RunLine) => item.toObject()); - } - return data; - } - serialize(): Uint8Array; - serialize(w: pb_1.BinaryWriter): void; - serialize(w?: pb_1.BinaryWriter): Uint8Array | void { - const writer = w || new pb_1.BinaryWriter(); - if (this.has_canvas) - writer.writeMessage(1, this.canvas, () => - this.canvas.serialize(writer) - ); - if (this.links.length) - writer.writeRepeatedMessage(2, this.links, (item: Link) => - item.serialize(writer) - ); - if (this.iscsFans.length) - writer.writeRepeatedMessage(3, this.iscsFans, (item: IscsFan) => - item.serialize(writer) - ); - if (this.Platforms.length) - writer.writeRepeatedMessage(4, this.Platforms, (item: Platform) => - item.serialize(writer) - ); - if (this.stations.length) - writer.writeRepeatedMessage(5, this.stations, (item: Station) => - item.serialize(writer) - ); - if (this.rects.length) - writer.writeRepeatedMessage(6, this.rects, (item: Rect) => - item.serialize(writer) - ); - if (this.train.length) - writer.writeRepeatedMessage(7, this.train, (item: Train) => - item.serialize(writer) - ); - if (this.signals.length) - writer.writeRepeatedMessage(8, this.signals, (item: Signal) => - item.serialize(writer) - ); - if (this.turnouts.length) - writer.writeRepeatedMessage(9, this.turnouts, (item: Turnout) => - item.serialize(writer) - ); - if (this.section.length) - writer.writeRepeatedMessage(10, this.section, (item: Section) => - item.serialize(writer) - ); - if (this.stationLines.length) - writer.writeRepeatedMessage( - 11, - this.stationLines, - (item: StationLine) => item.serialize(writer) - ); - if (this.runLines.length) - writer.writeRepeatedMessage(12, this.runLines, (item: RunLine) => - item.serialize(writer) - ); - if (!w) return writer.getResultBuffer(); - } - static deserialize( - bytes: Uint8Array | pb_1.BinaryReader - ): RtssGraphicStorage { - const reader = - bytes instanceof pb_1.BinaryReader - ? bytes - : new pb_1.BinaryReader(bytes), - message = new RtssGraphicStorage(); - while (reader.nextField()) { - if (reader.isEndGroup()) break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage( - message.canvas, - () => (message.canvas = Canvas.deserialize(reader)) - ); - break; - case 2: - reader.readMessage(message.links, () => - pb_1.Message.addToRepeatedWrapperField( - message, - 2, - Link.deserialize(reader), - Link - ) - ); - break; - case 3: - reader.readMessage(message.iscsFans, () => - pb_1.Message.addToRepeatedWrapperField( - message, - 3, - IscsFan.deserialize(reader), - IscsFan - ) - ); - break; - case 4: - reader.readMessage(message.Platforms, () => - pb_1.Message.addToRepeatedWrapperField( - message, - 4, - Platform.deserialize(reader), - Platform - ) - ); - break; - case 5: - reader.readMessage(message.stations, () => - pb_1.Message.addToRepeatedWrapperField( - message, - 5, - Station.deserialize(reader), - Station - ) - ); - break; - case 6: - reader.readMessage(message.rects, () => - pb_1.Message.addToRepeatedWrapperField( - message, - 6, - Rect.deserialize(reader), - Rect - ) - ); - break; - case 7: - reader.readMessage(message.train, () => - pb_1.Message.addToRepeatedWrapperField( - message, - 7, - Train.deserialize(reader), - Train - ) - ); - break; - case 8: - reader.readMessage(message.signals, () => - pb_1.Message.addToRepeatedWrapperField( - message, - 8, - Signal.deserialize(reader), - Signal - ) - ); - break; - case 9: - reader.readMessage(message.turnouts, () => - pb_1.Message.addToRepeatedWrapperField( - message, - 9, - Turnout.deserialize(reader), - Turnout - ) - ); - break; - case 10: - reader.readMessage(message.section, () => - pb_1.Message.addToRepeatedWrapperField( - message, - 10, - Section.deserialize(reader), - Section - ) - ); - break; - case 11: - reader.readMessage(message.stationLines, () => - pb_1.Message.addToRepeatedWrapperField( - message, - 11, - StationLine.deserialize(reader), - StationLine - ) - ); - break; - case 12: - reader.readMessage(message.runLines, () => - pb_1.Message.addToRepeatedWrapperField( - message, - 12, - RunLine.deserialize(reader), - RunLine - ) - ); - break; - default: - reader.skipField(); + get rects() { + return pb_1.Message.getRepeatedWrapperField(this, Rect, 6) as Rect[]; + } + set rects(value: Rect[]) { + pb_1.Message.setRepeatedWrapperField(this, 6, value); + } + get train() { + return pb_1.Message.getRepeatedWrapperField(this, Train, 7) as Train[]; + } + set train(value: Train[]) { + pb_1.Message.setRepeatedWrapperField(this, 7, value); + } + get signals() { + return pb_1.Message.getRepeatedWrapperField(this, Signal, 8) as Signal[]; + } + set signals(value: Signal[]) { + pb_1.Message.setRepeatedWrapperField(this, 8, value); + } + get turnouts() { + return pb_1.Message.getRepeatedWrapperField(this, Turnout, 9) as Turnout[]; + } + set turnouts(value: Turnout[]) { + pb_1.Message.setRepeatedWrapperField(this, 9, value); + } + get section() { + return pb_1.Message.getRepeatedWrapperField(this, Section, 10) as Section[]; + } + set section(value: Section[]) { + pb_1.Message.setRepeatedWrapperField(this, 10, value); + } + get stationLines() { + return pb_1.Message.getRepeatedWrapperField(this, StationLine, 11) as StationLine[]; + } + set stationLines(value: StationLine[]) { + pb_1.Message.setRepeatedWrapperField(this, 11, value); + } + get runLines() { + return pb_1.Message.getRepeatedWrapperField(this, RunLine, 12) as RunLine[]; + } + set runLines(value: RunLine[]) { + pb_1.Message.setRepeatedWrapperField(this, 12, value); + } + get trainLines() { + return pb_1.Message.getRepeatedWrapperField(this, TrainLine, 13) as TrainLine[]; + } + set trainLines(value: TrainLine[]) { + pb_1.Message.setRepeatedWrapperField(this, 13, value); + } + static fromObject(data: { + canvas?: ReturnType; + links?: ReturnType[]; + iscsFans?: ReturnType[]; + Platforms?: ReturnType[]; + stations?: ReturnType[]; + rects?: ReturnType[]; + train?: ReturnType[]; + signals?: ReturnType[]; + turnouts?: ReturnType[]; + section?: ReturnType[]; + stationLines?: ReturnType[]; + runLines?: ReturnType[]; + trainLines?: ReturnType[]; + }): RtssGraphicStorage { + const message = new RtssGraphicStorage({}); + if (data.canvas != null) { + message.canvas = Canvas.fromObject(data.canvas); + } + if (data.links != null) { + message.links = data.links.map(item => Link.fromObject(item)); + } + if (data.iscsFans != null) { + message.iscsFans = data.iscsFans.map(item => IscsFan.fromObject(item)); + } + if (data.Platforms != null) { + message.Platforms = data.Platforms.map(item => Platform.fromObject(item)); + } + if (data.stations != null) { + message.stations = data.stations.map(item => Station.fromObject(item)); + } + if (data.rects != null) { + message.rects = data.rects.map(item => Rect.fromObject(item)); + } + if (data.train != null) { + message.train = data.train.map(item => Train.fromObject(item)); + } + if (data.signals != null) { + message.signals = data.signals.map(item => Signal.fromObject(item)); + } + if (data.turnouts != null) { + message.turnouts = data.turnouts.map(item => Turnout.fromObject(item)); + } + if (data.section != null) { + message.section = data.section.map(item => Section.fromObject(item)); + } + if (data.stationLines != null) { + message.stationLines = data.stationLines.map(item => StationLine.fromObject(item)); + } + if (data.runLines != null) { + message.runLines = data.runLines.map(item => RunLine.fromObject(item)); + } + if (data.trainLines != null) { + message.trainLines = data.trainLines.map(item => TrainLine.fromObject(item)); + } + return message; + } + toObject() { + const data: { + canvas?: ReturnType; + links?: ReturnType[]; + iscsFans?: ReturnType[]; + Platforms?: ReturnType[]; + stations?: ReturnType[]; + rects?: ReturnType[]; + train?: ReturnType[]; + signals?: ReturnType[]; + turnouts?: ReturnType[]; + section?: ReturnType[]; + stationLines?: ReturnType[]; + runLines?: ReturnType[]; + trainLines?: ReturnType[]; + } = {}; + if (this.canvas != null) { + data.canvas = this.canvas.toObject(); + } + if (this.links != null) { + data.links = this.links.map((item: Link) => item.toObject()); + } + if (this.iscsFans != null) { + data.iscsFans = this.iscsFans.map((item: IscsFan) => item.toObject()); + } + if (this.Platforms != null) { + data.Platforms = this.Platforms.map((item: Platform) => item.toObject()); + } + if (this.stations != null) { + data.stations = this.stations.map((item: Station) => item.toObject()); + } + if (this.rects != null) { + data.rects = this.rects.map((item: Rect) => item.toObject()); + } + if (this.train != null) { + data.train = this.train.map((item: Train) => item.toObject()); + } + if (this.signals != null) { + data.signals = this.signals.map((item: Signal) => item.toObject()); + } + if (this.turnouts != null) { + data.turnouts = this.turnouts.map((item: Turnout) => item.toObject()); + } + if (this.section != null) { + data.section = this.section.map((item: Section) => item.toObject()); + } + if (this.stationLines != null) { + data.stationLines = this.stationLines.map((item: StationLine) => item.toObject()); + } + if (this.runLines != null) { + data.runLines = this.runLines.map((item: RunLine) => item.toObject()); + } + if (this.trainLines != null) { + data.trainLines = this.trainLines.map((item: TrainLine) => item.toObject()); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.has_canvas) + writer.writeMessage(1, this.canvas, () => this.canvas.serialize(writer)); + if (this.links.length) + writer.writeRepeatedMessage(2, this.links, (item: Link) => item.serialize(writer)); + if (this.iscsFans.length) + writer.writeRepeatedMessage(3, this.iscsFans, (item: IscsFan) => item.serialize(writer)); + if (this.Platforms.length) + writer.writeRepeatedMessage(4, this.Platforms, (item: Platform) => item.serialize(writer)); + if (this.stations.length) + writer.writeRepeatedMessage(5, this.stations, (item: Station) => item.serialize(writer)); + if (this.rects.length) + writer.writeRepeatedMessage(6, this.rects, (item: Rect) => item.serialize(writer)); + if (this.train.length) + writer.writeRepeatedMessage(7, this.train, (item: Train) => item.serialize(writer)); + if (this.signals.length) + writer.writeRepeatedMessage(8, this.signals, (item: Signal) => item.serialize(writer)); + if (this.turnouts.length) + writer.writeRepeatedMessage(9, this.turnouts, (item: Turnout) => item.serialize(writer)); + if (this.section.length) + writer.writeRepeatedMessage(10, this.section, (item: Section) => item.serialize(writer)); + if (this.stationLines.length) + writer.writeRepeatedMessage(11, this.stationLines, (item: StationLine) => item.serialize(writer)); + if (this.runLines.length) + writer.writeRepeatedMessage(12, this.runLines, (item: RunLine) => item.serialize(writer)); + if (this.trainLines.length) + writer.writeRepeatedMessage(13, this.trainLines, (item: TrainLine) => item.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): RtssGraphicStorage { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new RtssGraphicStorage(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.canvas, () => message.canvas = Canvas.deserialize(reader)); + break; + case 2: + reader.readMessage(message.links, () => pb_1.Message.addToRepeatedWrapperField(message, 2, Link.deserialize(reader), Link)); + break; + case 3: + reader.readMessage(message.iscsFans, () => pb_1.Message.addToRepeatedWrapperField(message, 3, IscsFan.deserialize(reader), IscsFan)); + break; + case 4: + reader.readMessage(message.Platforms, () => pb_1.Message.addToRepeatedWrapperField(message, 4, Platform.deserialize(reader), Platform)); + break; + case 5: + reader.readMessage(message.stations, () => pb_1.Message.addToRepeatedWrapperField(message, 5, Station.deserialize(reader), Station)); + break; + case 6: + reader.readMessage(message.rects, () => pb_1.Message.addToRepeatedWrapperField(message, 6, Rect.deserialize(reader), Rect)); + break; + case 7: + reader.readMessage(message.train, () => pb_1.Message.addToRepeatedWrapperField(message, 7, Train.deserialize(reader), Train)); + break; + case 8: + reader.readMessage(message.signals, () => pb_1.Message.addToRepeatedWrapperField(message, 8, Signal.deserialize(reader), Signal)); + break; + case 9: + reader.readMessage(message.turnouts, () => pb_1.Message.addToRepeatedWrapperField(message, 9, Turnout.deserialize(reader), Turnout)); + break; + case 10: + reader.readMessage(message.section, () => pb_1.Message.addToRepeatedWrapperField(message, 10, Section.deserialize(reader), Section)); + break; + case 11: + reader.readMessage(message.stationLines, () => pb_1.Message.addToRepeatedWrapperField(message, 11, StationLine.deserialize(reader), StationLine)); + break; + case 12: + reader.readMessage(message.runLines, () => pb_1.Message.addToRepeatedWrapperField(message, 12, RunLine.deserialize(reader), RunLine)); + break; + case 13: + reader.readMessage(message.trainLines, () => pb_1.Message.addToRepeatedWrapperField(message, 13, TrainLine.deserialize(reader), TrainLine)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): RtssGraphicStorage { + return RtssGraphicStorage.deserialize(bytes); } - } - return message; } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): RtssGraphicStorage { - return RtssGraphicStorage.deserialize(bytes); - } - } - export class Canvas extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor( - data?: - | any[] - | { + export class Canvas extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { width?: number; height?: number; backgroundColor?: string; viewportTransform?: Transform; - } - ) { - super(); - pb_1.Message.initialize( - this, - Array.isArray(data) ? data : [], - 0, - -1, - [], - this.#one_of_decls - ); - if (!Array.isArray(data) && typeof data == 'object') { - if ('width' in data && data.width != undefined) { - this.width = data.width; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("width" in data && data.width != undefined) { + this.width = data.width; + } + if ("height" in data && data.height != undefined) { + this.height = data.height; + } + if ("backgroundColor" in data && data.backgroundColor != undefined) { + this.backgroundColor = data.backgroundColor; + } + if ("viewportTransform" in data && data.viewportTransform != undefined) { + this.viewportTransform = data.viewportTransform; + } + } } - if ('height' in data && data.height != undefined) { - this.height = data.height; + get width() { + return pb_1.Message.getFieldWithDefault(this, 1, 0) as number; } - if ('backgroundColor' in data && data.backgroundColor != undefined) { - this.backgroundColor = data.backgroundColor; + set width(value: number) { + pb_1.Message.setField(this, 1, value); } - if ( - 'viewportTransform' in data && - data.viewportTransform != undefined - ) { - this.viewportTransform = data.viewportTransform; + get height() { + return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; } - } - } - get width() { - return pb_1.Message.getFieldWithDefault(this, 1, 0) as number; - } - set width(value: number) { - pb_1.Message.setField(this, 1, value); - } - get height() { - return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; - } - set height(value: number) { - pb_1.Message.setField(this, 2, value); - } - get backgroundColor() { - return pb_1.Message.getFieldWithDefault(this, 3, '') as string; - } - set backgroundColor(value: string) { - pb_1.Message.setField(this, 3, value); - } - get viewportTransform() { - return pb_1.Message.getWrapperField(this, Transform, 4) as Transform; - } - set viewportTransform(value: Transform) { - pb_1.Message.setWrapperField(this, 4, value); - } - get has_viewportTransform() { - return pb_1.Message.getField(this, 4) != null; - } - static fromObject(data: { - width?: number; - height?: number; - backgroundColor?: string; - viewportTransform?: ReturnType; - }): Canvas { - const message = new Canvas({}); - if (data.width != null) { - message.width = data.width; - } - if (data.height != null) { - message.height = data.height; - } - if (data.backgroundColor != null) { - message.backgroundColor = data.backgroundColor; - } - if (data.viewportTransform != null) { - message.viewportTransform = Transform.fromObject( - data.viewportTransform - ); - } - return message; - } - toObject() { - const data: { - width?: number; - height?: number; - backgroundColor?: string; - viewportTransform?: ReturnType; - } = {}; - if (this.width != null) { - data.width = this.width; - } - if (this.height != null) { - data.height = this.height; - } - if (this.backgroundColor != null) { - data.backgroundColor = this.backgroundColor; - } - if (this.viewportTransform != null) { - data.viewportTransform = this.viewportTransform.toObject(); - } - return data; - } - serialize(): Uint8Array; - serialize(w: pb_1.BinaryWriter): void; - serialize(w?: pb_1.BinaryWriter): Uint8Array | void { - const writer = w || new pb_1.BinaryWriter(); - if (this.width != 0) writer.writeInt32(1, this.width); - if (this.height != 0) writer.writeInt32(2, this.height); - if (this.backgroundColor.length) - writer.writeString(3, this.backgroundColor); - if (this.has_viewportTransform) - writer.writeMessage(4, this.viewportTransform, () => - this.viewportTransform.serialize(writer) - ); - if (!w) return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Canvas { - const reader = - bytes instanceof pb_1.BinaryReader - ? bytes - : new pb_1.BinaryReader(bytes), - message = new Canvas(); - while (reader.nextField()) { - if (reader.isEndGroup()) break; - switch (reader.getFieldNumber()) { - case 1: - message.width = reader.readInt32(); - break; - case 2: - message.height = reader.readInt32(); - break; - case 3: - message.backgroundColor = reader.readString(); - break; - case 4: - reader.readMessage( - message.viewportTransform, - () => (message.viewportTransform = Transform.deserialize(reader)) - ); - break; - default: - reader.skipField(); + set height(value: number) { + pb_1.Message.setField(this, 2, value); + } + get backgroundColor() { + return pb_1.Message.getFieldWithDefault(this, 3, "") as string; + } + set backgroundColor(value: string) { + pb_1.Message.setField(this, 3, value); + } + get viewportTransform() { + return pb_1.Message.getWrapperField(this, Transform, 4) as Transform; + } + set viewportTransform(value: Transform) { + pb_1.Message.setWrapperField(this, 4, value); + } + get has_viewportTransform() { + return pb_1.Message.getField(this, 4) != null; + } + static fromObject(data: { + width?: number; + height?: number; + backgroundColor?: string; + viewportTransform?: ReturnType; + }): Canvas { + const message = new Canvas({}); + if (data.width != null) { + message.width = data.width; + } + if (data.height != null) { + message.height = data.height; + } + if (data.backgroundColor != null) { + message.backgroundColor = data.backgroundColor; + } + if (data.viewportTransform != null) { + message.viewportTransform = Transform.fromObject(data.viewportTransform); + } + return message; + } + toObject() { + const data: { + width?: number; + height?: number; + backgroundColor?: string; + viewportTransform?: ReturnType; + } = {}; + if (this.width != null) { + data.width = this.width; + } + if (this.height != null) { + data.height = this.height; + } + if (this.backgroundColor != null) { + data.backgroundColor = this.backgroundColor; + } + if (this.viewportTransform != null) { + data.viewportTransform = this.viewportTransform.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.width != 0) + writer.writeInt32(1, this.width); + if (this.height != 0) + writer.writeInt32(2, this.height); + if (this.backgroundColor.length) + writer.writeString(3, this.backgroundColor); + if (this.has_viewportTransform) + writer.writeMessage(4, this.viewportTransform, () => this.viewportTransform.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Canvas { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Canvas(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.width = reader.readInt32(); + break; + case 2: + message.height = reader.readInt32(); + break; + case 3: + message.backgroundColor = reader.readString(); + break; + case 4: + reader.readMessage(message.viewportTransform, () => message.viewportTransform = Transform.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Canvas { + return Canvas.deserialize(bytes); } - } - return message; } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): Canvas { - return Canvas.deserialize(bytes); - } - } - export class Point extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor( - data?: - | any[] - | { + export class Point extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { x?: number; y?: number; - } - ) { - super(); - pb_1.Message.initialize( - this, - Array.isArray(data) ? data : [], - 0, - -1, - [], - this.#one_of_decls - ); - if (!Array.isArray(data) && typeof data == 'object') { - if ('x' in data && data.x != undefined) { - this.x = data.x; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("x" in data && data.x != undefined) { + this.x = data.x; + } + if ("y" in data && data.y != undefined) { + this.y = data.y; + } + } } - if ('y' in data && data.y != undefined) { - this.y = data.y; + get x() { + return pb_1.Message.getFieldWithDefault(this, 1, 0) as number; } - } - } - get x() { - return pb_1.Message.getFieldWithDefault(this, 1, 0) as number; - } - set x(value: number) { - pb_1.Message.setField(this, 1, value); - } - get y() { - return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; - } - set y(value: number) { - pb_1.Message.setField(this, 2, value); - } - static fromObject(data: { x?: number; y?: number }): Point { - const message = new Point({}); - if (data.x != null) { - message.x = data.x; - } - if (data.y != null) { - message.y = data.y; - } - return message; - } - toObject() { - const data: { - x?: number; - y?: number; - } = {}; - if (this.x != null) { - data.x = this.x; - } - if (this.y != null) { - data.y = this.y; - } - return data; - } - serialize(): Uint8Array; - serialize(w: pb_1.BinaryWriter): void; - serialize(w?: pb_1.BinaryWriter): Uint8Array | void { - const writer = w || new pb_1.BinaryWriter(); - if (this.x != 0) writer.writeFloat(1, this.x); - if (this.y != 0) writer.writeFloat(2, this.y); - if (!w) return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Point { - const reader = - bytes instanceof pb_1.BinaryReader - ? bytes - : new pb_1.BinaryReader(bytes), - message = new Point(); - while (reader.nextField()) { - if (reader.isEndGroup()) break; - switch (reader.getFieldNumber()) { - case 1: - message.x = reader.readFloat(); - break; - case 2: - message.y = reader.readFloat(); - break; - default: - reader.skipField(); + set x(value: number) { + pb_1.Message.setField(this, 1, value); + } + get y() { + return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; + } + set y(value: number) { + pb_1.Message.setField(this, 2, value); + } + static fromObject(data: { + x?: number; + y?: number; + }): Point { + const message = new Point({}); + if (data.x != null) { + message.x = data.x; + } + if (data.y != null) { + message.y = data.y; + } + return message; + } + toObject() { + const data: { + x?: number; + y?: number; + } = {}; + if (this.x != null) { + data.x = this.x; + } + if (this.y != null) { + data.y = this.y; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.x != 0) + writer.writeFloat(1, this.x); + if (this.y != 0) + writer.writeFloat(2, this.y); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Point { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Point(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.x = reader.readFloat(); + break; + case 2: + message.y = reader.readFloat(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Point { + return Point.deserialize(bytes); } - } - return message; } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): Point { - return Point.deserialize(bytes); - } - } - export class Transform extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor( - data?: - | any[] - | { + export class Transform extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { position?: Point; scale?: Point; rotation?: number; skew?: Point; - } - ) { - super(); - pb_1.Message.initialize( - this, - Array.isArray(data) ? data : [], - 0, - -1, - [], - this.#one_of_decls - ); - if (!Array.isArray(data) && typeof data == 'object') { - if ('position' in data && data.position != undefined) { - this.position = data.position; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("position" in data && data.position != undefined) { + this.position = data.position; + } + if ("scale" in data && data.scale != undefined) { + this.scale = data.scale; + } + if ("rotation" in data && data.rotation != undefined) { + this.rotation = data.rotation; + } + if ("skew" in data && data.skew != undefined) { + this.skew = data.skew; + } + } } - if ('scale' in data && data.scale != undefined) { - this.scale = data.scale; + get position() { + return pb_1.Message.getWrapperField(this, Point, 1) as Point; } - if ('rotation' in data && data.rotation != undefined) { - this.rotation = data.rotation; + set position(value: Point) { + pb_1.Message.setWrapperField(this, 1, value); } - if ('skew' in data && data.skew != undefined) { - this.skew = data.skew; + get has_position() { + return pb_1.Message.getField(this, 1) != null; } - } - } - get position() { - return pb_1.Message.getWrapperField(this, Point, 1) as Point; - } - set position(value: Point) { - pb_1.Message.setWrapperField(this, 1, value); - } - get has_position() { - return pb_1.Message.getField(this, 1) != null; - } - get scale() { - return pb_1.Message.getWrapperField(this, Point, 2) as Point; - } - set scale(value: Point) { - pb_1.Message.setWrapperField(this, 2, value); - } - get has_scale() { - return pb_1.Message.getField(this, 2) != null; - } - get rotation() { - return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; - } - set rotation(value: number) { - pb_1.Message.setField(this, 3, value); - } - get skew() { - return pb_1.Message.getWrapperField(this, Point, 4) as Point; - } - set skew(value: Point) { - pb_1.Message.setWrapperField(this, 4, value); - } - get has_skew() { - return pb_1.Message.getField(this, 4) != null; - } - static fromObject(data: { - position?: ReturnType; - scale?: ReturnType; - rotation?: number; - skew?: ReturnType; - }): Transform { - const message = new Transform({}); - if (data.position != null) { - message.position = Point.fromObject(data.position); - } - if (data.scale != null) { - message.scale = Point.fromObject(data.scale); - } - if (data.rotation != null) { - message.rotation = data.rotation; - } - if (data.skew != null) { - message.skew = Point.fromObject(data.skew); - } - return message; - } - toObject() { - const data: { - position?: ReturnType; - scale?: ReturnType; - rotation?: number; - skew?: ReturnType; - } = {}; - if (this.position != null) { - data.position = this.position.toObject(); - } - if (this.scale != null) { - data.scale = this.scale.toObject(); - } - if (this.rotation != null) { - data.rotation = this.rotation; - } - if (this.skew != null) { - data.skew = this.skew.toObject(); - } - return data; - } - serialize(): Uint8Array; - serialize(w: pb_1.BinaryWriter): void; - serialize(w?: pb_1.BinaryWriter): Uint8Array | void { - const writer = w || new pb_1.BinaryWriter(); - if (this.has_position) - writer.writeMessage(1, this.position, () => - this.position.serialize(writer) - ); - if (this.has_scale) - writer.writeMessage(2, this.scale, () => this.scale.serialize(writer)); - if (this.rotation != 0) writer.writeFloat(3, this.rotation); - if (this.has_skew) - writer.writeMessage(4, this.skew, () => this.skew.serialize(writer)); - if (!w) return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Transform { - const reader = - bytes instanceof pb_1.BinaryReader - ? bytes - : new pb_1.BinaryReader(bytes), - message = new Transform(); - while (reader.nextField()) { - if (reader.isEndGroup()) break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage( - message.position, - () => (message.position = Point.deserialize(reader)) - ); - break; - case 2: - reader.readMessage( - message.scale, - () => (message.scale = Point.deserialize(reader)) - ); - break; - case 3: - message.rotation = reader.readFloat(); - break; - case 4: - reader.readMessage( - message.skew, - () => (message.skew = Point.deserialize(reader)) - ); - break; - default: - reader.skipField(); + get scale() { + return pb_1.Message.getWrapperField(this, Point, 2) as Point; + } + set scale(value: Point) { + pb_1.Message.setWrapperField(this, 2, value); + } + get has_scale() { + return pb_1.Message.getField(this, 2) != null; + } + get rotation() { + return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; + } + set rotation(value: number) { + pb_1.Message.setField(this, 3, value); + } + get skew() { + return pb_1.Message.getWrapperField(this, Point, 4) as Point; + } + set skew(value: Point) { + pb_1.Message.setWrapperField(this, 4, value); + } + get has_skew() { + return pb_1.Message.getField(this, 4) != null; + } + static fromObject(data: { + position?: ReturnType; + scale?: ReturnType; + rotation?: number; + skew?: ReturnType; + }): Transform { + const message = new Transform({}); + if (data.position != null) { + message.position = Point.fromObject(data.position); + } + if (data.scale != null) { + message.scale = Point.fromObject(data.scale); + } + if (data.rotation != null) { + message.rotation = data.rotation; + } + if (data.skew != null) { + message.skew = Point.fromObject(data.skew); + } + return message; + } + toObject() { + const data: { + position?: ReturnType; + scale?: ReturnType; + rotation?: number; + skew?: ReturnType; + } = {}; + if (this.position != null) { + data.position = this.position.toObject(); + } + if (this.scale != null) { + data.scale = this.scale.toObject(); + } + if (this.rotation != null) { + data.rotation = this.rotation; + } + if (this.skew != null) { + data.skew = this.skew.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.has_position) + writer.writeMessage(1, this.position, () => this.position.serialize(writer)); + if (this.has_scale) + writer.writeMessage(2, this.scale, () => this.scale.serialize(writer)); + if (this.rotation != 0) + writer.writeFloat(3, this.rotation); + if (this.has_skew) + writer.writeMessage(4, this.skew, () => this.skew.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Transform { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Transform(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.position, () => message.position = Point.deserialize(reader)); + break; + case 2: + reader.readMessage(message.scale, () => message.scale = Point.deserialize(reader)); + break; + case 3: + message.rotation = reader.readFloat(); + break; + case 4: + reader.readMessage(message.skew, () => message.skew = Point.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Transform { + return Transform.deserialize(bytes); } - } - return message; } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): Transform { - return Transform.deserialize(bytes); - } - } - export class ChildTransform extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor( - data?: - | any[] - | { + export class ChildTransform extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { name?: string; transform?: Transform; - } - ) { - super(); - pb_1.Message.initialize( - this, - Array.isArray(data) ? data : [], - 0, - -1, - [], - this.#one_of_decls - ); - if (!Array.isArray(data) && typeof data == 'object') { - if ('name' in data && data.name != undefined) { - this.name = data.name; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("name" in data && data.name != undefined) { + this.name = data.name; + } + if ("transform" in data && data.transform != undefined) { + this.transform = data.transform; + } + } } - if ('transform' in data && data.transform != undefined) { - this.transform = data.transform; + get name() { + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } - } - } - get name() { - return pb_1.Message.getFieldWithDefault(this, 1, '') as string; - } - set name(value: string) { - pb_1.Message.setField(this, 1, value); - } - get transform() { - return pb_1.Message.getWrapperField(this, Transform, 2) as Transform; - } - set transform(value: Transform) { - pb_1.Message.setWrapperField(this, 2, value); - } - get has_transform() { - return pb_1.Message.getField(this, 2) != null; - } - static fromObject(data: { - name?: string; - transform?: ReturnType; - }): ChildTransform { - const message = new ChildTransform({}); - if (data.name != null) { - message.name = data.name; - } - if (data.transform != null) { - message.transform = Transform.fromObject(data.transform); - } - return message; - } - toObject() { - const data: { - name?: string; - transform?: ReturnType; - } = {}; - if (this.name != null) { - data.name = this.name; - } - if (this.transform != null) { - data.transform = this.transform.toObject(); - } - return data; - } - serialize(): Uint8Array; - serialize(w: pb_1.BinaryWriter): void; - serialize(w?: pb_1.BinaryWriter): Uint8Array | void { - const writer = w || new pb_1.BinaryWriter(); - if (this.name.length) writer.writeString(1, this.name); - if (this.has_transform) - writer.writeMessage(2, this.transform, () => - this.transform.serialize(writer) - ); - if (!w) return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ChildTransform { - const reader = - bytes instanceof pb_1.BinaryReader - ? bytes - : new pb_1.BinaryReader(bytes), - message = new ChildTransform(); - while (reader.nextField()) { - if (reader.isEndGroup()) break; - switch (reader.getFieldNumber()) { - case 1: - message.name = reader.readString(); - break; - case 2: - reader.readMessage( - message.transform, - () => (message.transform = Transform.deserialize(reader)) - ); - break; - default: - reader.skipField(); + set name(value: string) { + pb_1.Message.setField(this, 1, value); + } + get transform() { + return pb_1.Message.getWrapperField(this, Transform, 2) as Transform; + } + set transform(value: Transform) { + pb_1.Message.setWrapperField(this, 2, value); + } + get has_transform() { + return pb_1.Message.getField(this, 2) != null; + } + static fromObject(data: { + name?: string; + transform?: ReturnType; + }): ChildTransform { + const message = new ChildTransform({}); + if (data.name != null) { + message.name = data.name; + } + if (data.transform != null) { + message.transform = Transform.fromObject(data.transform); + } + return message; + } + toObject() { + const data: { + name?: string; + transform?: ReturnType; + } = {}; + if (this.name != null) { + data.name = this.name; + } + if (this.transform != null) { + data.transform = this.transform.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.name.length) + writer.writeString(1, this.name); + if (this.has_transform) + writer.writeMessage(2, this.transform, () => this.transform.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ChildTransform { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new ChildTransform(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.name = reader.readString(); + break; + case 2: + reader.readMessage(message.transform, () => message.transform = Transform.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): ChildTransform { + return ChildTransform.deserialize(bytes); } - } - return message; } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): ChildTransform { - return ChildTransform.deserialize(bytes); - } - } - export class CommonInfo extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor( - data?: - | any[] - | { + export class CommonInfo extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { id?: string; graphicType?: string; transform?: Transform; childTransforms?: ChildTransform[]; - } - ) { - super(); - pb_1.Message.initialize( - this, - Array.isArray(data) ? data : [], - 0, - -1, - [4], - this.#one_of_decls - ); - if (!Array.isArray(data) && typeof data == 'object') { - if ('id' in data && data.id != undefined) { - this.id = data.id; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [4], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("id" in data && data.id != undefined) { + this.id = data.id; + } + if ("graphicType" in data && data.graphicType != undefined) { + this.graphicType = data.graphicType; + } + if ("transform" in data && data.transform != undefined) { + this.transform = data.transform; + } + if ("childTransforms" in data && data.childTransforms != undefined) { + this.childTransforms = data.childTransforms; + } + } } - if ('graphicType' in data && data.graphicType != undefined) { - this.graphicType = data.graphicType; + get id() { + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } - if ('transform' in data && data.transform != undefined) { - this.transform = data.transform; + set id(value: string) { + pb_1.Message.setField(this, 1, value); } - if ('childTransforms' in data && data.childTransforms != undefined) { - this.childTransforms = data.childTransforms; + get graphicType() { + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; } - } - } - get id() { - return pb_1.Message.getFieldWithDefault(this, 1, '') as string; - } - set id(value: string) { - pb_1.Message.setField(this, 1, value); - } - get graphicType() { - return pb_1.Message.getFieldWithDefault(this, 2, '') as string; - } - set graphicType(value: string) { - pb_1.Message.setField(this, 2, value); - } - get transform() { - return pb_1.Message.getWrapperField(this, Transform, 3) as Transform; - } - set transform(value: Transform) { - pb_1.Message.setWrapperField(this, 3, value); - } - get has_transform() { - return pb_1.Message.getField(this, 3) != null; - } - get childTransforms() { - return pb_1.Message.getRepeatedWrapperField( - this, - ChildTransform, - 4 - ) as ChildTransform[]; - } - set childTransforms(value: ChildTransform[]) { - pb_1.Message.setRepeatedWrapperField(this, 4, value); - } - static fromObject(data: { - id?: string; - graphicType?: string; - transform?: ReturnType; - childTransforms?: ReturnType[]; - }): CommonInfo { - const message = new CommonInfo({}); - if (data.id != null) { - message.id = data.id; - } - if (data.graphicType != null) { - message.graphicType = data.graphicType; - } - if (data.transform != null) { - message.transform = Transform.fromObject(data.transform); - } - if (data.childTransforms != null) { - message.childTransforms = data.childTransforms.map((item) => - ChildTransform.fromObject(item) - ); - } - return message; - } - toObject() { - const data: { - id?: string; - graphicType?: string; - transform?: ReturnType; - childTransforms?: ReturnType< - typeof ChildTransform.prototype.toObject - >[]; - } = {}; - if (this.id != null) { - data.id = this.id; - } - if (this.graphicType != null) { - data.graphicType = this.graphicType; - } - if (this.transform != null) { - data.transform = this.transform.toObject(); - } - if (this.childTransforms != null) { - data.childTransforms = this.childTransforms.map( - (item: ChildTransform) => item.toObject() - ); - } - return data; - } - serialize(): Uint8Array; - serialize(w: pb_1.BinaryWriter): void; - serialize(w?: pb_1.BinaryWriter): Uint8Array | void { - const writer = w || new pb_1.BinaryWriter(); - if (this.id.length) writer.writeString(1, this.id); - if (this.graphicType.length) writer.writeString(2, this.graphicType); - if (this.has_transform) - writer.writeMessage(3, this.transform, () => - this.transform.serialize(writer) - ); - if (this.childTransforms.length) - writer.writeRepeatedMessage( - 4, - this.childTransforms, - (item: ChildTransform) => item.serialize(writer) - ); - if (!w) return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): CommonInfo { - const reader = - bytes instanceof pb_1.BinaryReader - ? bytes - : new pb_1.BinaryReader(bytes), - message = new CommonInfo(); - while (reader.nextField()) { - if (reader.isEndGroup()) break; - switch (reader.getFieldNumber()) { - case 1: - message.id = reader.readString(); - break; - case 2: - message.graphicType = reader.readString(); - break; - case 3: - reader.readMessage( - message.transform, - () => (message.transform = Transform.deserialize(reader)) - ); - break; - case 4: - reader.readMessage(message.childTransforms, () => - pb_1.Message.addToRepeatedWrapperField( - message, - 4, - ChildTransform.deserialize(reader), - ChildTransform - ) - ); - break; - default: - reader.skipField(); + set graphicType(value: string) { + pb_1.Message.setField(this, 2, value); + } + get transform() { + return pb_1.Message.getWrapperField(this, Transform, 3) as Transform; + } + set transform(value: Transform) { + pb_1.Message.setWrapperField(this, 3, value); + } + get has_transform() { + return pb_1.Message.getField(this, 3) != null; + } + get childTransforms() { + return pb_1.Message.getRepeatedWrapperField(this, ChildTransform, 4) as ChildTransform[]; + } + set childTransforms(value: ChildTransform[]) { + pb_1.Message.setRepeatedWrapperField(this, 4, value); + } + static fromObject(data: { + id?: string; + graphicType?: string; + transform?: ReturnType; + childTransforms?: ReturnType[]; + }): CommonInfo { + const message = new CommonInfo({}); + if (data.id != null) { + message.id = data.id; + } + if (data.graphicType != null) { + message.graphicType = data.graphicType; + } + if (data.transform != null) { + message.transform = Transform.fromObject(data.transform); + } + if (data.childTransforms != null) { + message.childTransforms = data.childTransforms.map(item => ChildTransform.fromObject(item)); + } + return message; + } + toObject() { + const data: { + id?: string; + graphicType?: string; + transform?: ReturnType; + childTransforms?: ReturnType[]; + } = {}; + if (this.id != null) { + data.id = this.id; + } + if (this.graphicType != null) { + data.graphicType = this.graphicType; + } + if (this.transform != null) { + data.transform = this.transform.toObject(); + } + if (this.childTransforms != null) { + data.childTransforms = this.childTransforms.map((item: ChildTransform) => item.toObject()); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.id.length) + writer.writeString(1, this.id); + if (this.graphicType.length) + writer.writeString(2, this.graphicType); + if (this.has_transform) + writer.writeMessage(3, this.transform, () => this.transform.serialize(writer)); + if (this.childTransforms.length) + writer.writeRepeatedMessage(4, this.childTransforms, (item: ChildTransform) => item.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): CommonInfo { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new CommonInfo(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.id = reader.readString(); + break; + case 2: + message.graphicType = reader.readString(); + break; + case 3: + reader.readMessage(message.transform, () => message.transform = Transform.deserialize(reader)); + break; + case 4: + reader.readMessage(message.childTransforms, () => pb_1.Message.addToRepeatedWrapperField(message, 4, ChildTransform.deserialize(reader), ChildTransform)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): CommonInfo { + return CommonInfo.deserialize(bytes); } - } - return message; } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): CommonInfo { - return CommonInfo.deserialize(bytes); - } - } - export class Link extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor( - data?: - | any[] - | { + export class Link extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { common?: CommonInfo; code?: string; curve?: boolean; @@ -1224,230 +967,207 @@ export namespace graphicData { lineWidth?: number; lineColor?: string; points?: Point[]; - } - ) { - super(); - pb_1.Message.initialize( - this, - Array.isArray(data) ? data : [], - 0, - -1, - [7], - this.#one_of_decls - ); - if (!Array.isArray(data) && typeof data == 'object') { - if ('common' in data && data.common != undefined) { - this.common = data.common; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [7], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("common" in data && data.common != undefined) { + this.common = data.common; + } + if ("code" in data && data.code != undefined) { + this.code = data.code; + } + if ("curve" in data && data.curve != undefined) { + this.curve = data.curve; + } + if ("segmentsCount" in data && data.segmentsCount != undefined) { + this.segmentsCount = data.segmentsCount; + } + if ("lineWidth" in data && data.lineWidth != undefined) { + this.lineWidth = data.lineWidth; + } + if ("lineColor" in data && data.lineColor != undefined) { + this.lineColor = data.lineColor; + } + if ("points" in data && data.points != undefined) { + this.points = data.points; + } + } } - if ('code' in data && data.code != undefined) { - this.code = data.code; + get common() { + return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; } - if ('curve' in data && data.curve != undefined) { - this.curve = data.curve; + set common(value: CommonInfo) { + pb_1.Message.setWrapperField(this, 1, value); } - if ('segmentsCount' in data && data.segmentsCount != undefined) { - this.segmentsCount = data.segmentsCount; + get has_common() { + return pb_1.Message.getField(this, 1) != null; } - if ('lineWidth' in data && data.lineWidth != undefined) { - this.lineWidth = data.lineWidth; + get code() { + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; } - if ('lineColor' in data && data.lineColor != undefined) { - this.lineColor = data.lineColor; + set code(value: string) { + pb_1.Message.setField(this, 2, value); } - if ('points' in data && data.points != undefined) { - this.points = data.points; + get curve() { + return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean; } - } - } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; - } - set common(value: CommonInfo) { - pb_1.Message.setWrapperField(this, 1, value); - } - get has_common() { - return pb_1.Message.getField(this, 1) != null; - } - get code() { - return pb_1.Message.getFieldWithDefault(this, 2, '') as string; - } - set code(value: string) { - pb_1.Message.setField(this, 2, value); - } - get curve() { - return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean; - } - set curve(value: boolean) { - pb_1.Message.setField(this, 3, value); - } - get segmentsCount() { - return pb_1.Message.getFieldWithDefault(this, 4, 0) as number; - } - set segmentsCount(value: number) { - pb_1.Message.setField(this, 4, value); - } - get lineWidth() { - return pb_1.Message.getFieldWithDefault(this, 5, 0) as number; - } - set lineWidth(value: number) { - pb_1.Message.setField(this, 5, value); - } - get lineColor() { - return pb_1.Message.getFieldWithDefault(this, 6, '') as string; - } - set lineColor(value: string) { - pb_1.Message.setField(this, 6, value); - } - get points() { - return pb_1.Message.getRepeatedWrapperField(this, Point, 7) as Point[]; - } - set points(value: Point[]) { - pb_1.Message.setRepeatedWrapperField(this, 7, value); - } - static fromObject(data: { - common?: ReturnType; - code?: string; - curve?: boolean; - segmentsCount?: number; - lineWidth?: number; - lineColor?: string; - points?: ReturnType[]; - }): Link { - const message = new Link({}); - if (data.common != null) { - message.common = CommonInfo.fromObject(data.common); - } - if (data.code != null) { - message.code = data.code; - } - if (data.curve != null) { - message.curve = data.curve; - } - if (data.segmentsCount != null) { - message.segmentsCount = data.segmentsCount; - } - if (data.lineWidth != null) { - message.lineWidth = data.lineWidth; - } - if (data.lineColor != null) { - message.lineColor = data.lineColor; - } - if (data.points != null) { - message.points = data.points.map((item) => Point.fromObject(item)); - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - curve?: boolean; - segmentsCount?: number; - lineWidth?: number; - lineColor?: string; - points?: ReturnType[]; - } = {}; - if (this.common != null) { - data.common = this.common.toObject(); - } - if (this.code != null) { - data.code = this.code; - } - if (this.curve != null) { - data.curve = this.curve; - } - if (this.segmentsCount != null) { - data.segmentsCount = this.segmentsCount; - } - if (this.lineWidth != null) { - data.lineWidth = this.lineWidth; - } - if (this.lineColor != null) { - data.lineColor = this.lineColor; - } - if (this.points != null) { - data.points = this.points.map((item: Point) => item.toObject()); - } - return data; - } - serialize(): Uint8Array; - serialize(w: pb_1.BinaryWriter): void; - serialize(w?: pb_1.BinaryWriter): Uint8Array | void { - const writer = w || new pb_1.BinaryWriter(); - if (this.has_common) - writer.writeMessage(1, this.common, () => - this.common.serialize(writer) - ); - if (this.code.length) writer.writeString(2, this.code); - if (this.curve != false) writer.writeBool(3, this.curve); - if (this.segmentsCount != 0) writer.writeInt32(4, this.segmentsCount); - if (this.lineWidth != 0) writer.writeInt32(5, this.lineWidth); - if (this.lineColor.length) writer.writeString(6, this.lineColor); - if (this.points.length) - writer.writeRepeatedMessage(7, this.points, (item: Point) => - item.serialize(writer) - ); - if (!w) return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Link { - const reader = - bytes instanceof pb_1.BinaryReader - ? bytes - : new pb_1.BinaryReader(bytes), - message = new Link(); - while (reader.nextField()) { - if (reader.isEndGroup()) break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage( - message.common, - () => (message.common = CommonInfo.deserialize(reader)) - ); - break; - case 2: - message.code = reader.readString(); - break; - case 3: - message.curve = reader.readBool(); - break; - case 4: - message.segmentsCount = reader.readInt32(); - break; - case 5: - message.lineWidth = reader.readInt32(); - break; - case 6: - message.lineColor = reader.readString(); - break; - case 7: - reader.readMessage(message.points, () => - pb_1.Message.addToRepeatedWrapperField( - message, - 7, - Point.deserialize(reader), - Point - ) - ); - break; - default: - reader.skipField(); + set curve(value: boolean) { + pb_1.Message.setField(this, 3, value); + } + get segmentsCount() { + return pb_1.Message.getFieldWithDefault(this, 4, 0) as number; + } + set segmentsCount(value: number) { + pb_1.Message.setField(this, 4, value); + } + get lineWidth() { + return pb_1.Message.getFieldWithDefault(this, 5, 0) as number; + } + set lineWidth(value: number) { + pb_1.Message.setField(this, 5, value); + } + get lineColor() { + return pb_1.Message.getFieldWithDefault(this, 6, "") as string; + } + set lineColor(value: string) { + pb_1.Message.setField(this, 6, value); + } + get points() { + return pb_1.Message.getRepeatedWrapperField(this, Point, 7) as Point[]; + } + set points(value: Point[]) { + pb_1.Message.setRepeatedWrapperField(this, 7, value); + } + static fromObject(data: { + common?: ReturnType; + code?: string; + curve?: boolean; + segmentsCount?: number; + lineWidth?: number; + lineColor?: string; + points?: ReturnType[]; + }): Link { + const message = new Link({}); + if (data.common != null) { + message.common = CommonInfo.fromObject(data.common); + } + if (data.code != null) { + message.code = data.code; + } + if (data.curve != null) { + message.curve = data.curve; + } + if (data.segmentsCount != null) { + message.segmentsCount = data.segmentsCount; + } + if (data.lineWidth != null) { + message.lineWidth = data.lineWidth; + } + if (data.lineColor != null) { + message.lineColor = data.lineColor; + } + if (data.points != null) { + message.points = data.points.map(item => Point.fromObject(item)); + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + curve?: boolean; + segmentsCount?: number; + lineWidth?: number; + lineColor?: string; + points?: ReturnType[]; + } = {}; + if (this.common != null) { + data.common = this.common.toObject(); + } + if (this.code != null) { + data.code = this.code; + } + if (this.curve != null) { + data.curve = this.curve; + } + if (this.segmentsCount != null) { + data.segmentsCount = this.segmentsCount; + } + if (this.lineWidth != null) { + data.lineWidth = this.lineWidth; + } + if (this.lineColor != null) { + data.lineColor = this.lineColor; + } + if (this.points != null) { + data.points = this.points.map((item: Point) => item.toObject()); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.has_common) + writer.writeMessage(1, this.common, () => this.common.serialize(writer)); + if (this.code.length) + writer.writeString(2, this.code); + if (this.curve != false) + writer.writeBool(3, this.curve); + if (this.segmentsCount != 0) + writer.writeInt32(4, this.segmentsCount); + if (this.lineWidth != 0) + writer.writeInt32(5, this.lineWidth); + if (this.lineColor.length) + writer.writeString(6, this.lineColor); + if (this.points.length) + writer.writeRepeatedMessage(7, this.points, (item: Point) => item.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Link { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Link(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.common, () => message.common = CommonInfo.deserialize(reader)); + break; + case 2: + message.code = reader.readString(); + break; + case 3: + message.curve = reader.readBool(); + break; + case 4: + message.segmentsCount = reader.readInt32(); + break; + case 5: + message.lineWidth = reader.readInt32(); + break; + case 6: + message.lineColor = reader.readString(); + break; + case 7: + reader.readMessage(message.points, () => pb_1.Message.addToRepeatedWrapperField(message, 7, Point.deserialize(reader), Point)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Link { + return Link.deserialize(bytes); } - } - return message; } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): Link { - return Link.deserialize(bytes); - } - } - export class Rect extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor( - data?: - | any[] - | { + export class Rect extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { common?: CommonInfo; code?: string; lineWidth?: number; @@ -1456,1582 +1176,1468 @@ export namespace graphicData { height?: number; radius?: number; point?: Point; - } - ) { - super(); - pb_1.Message.initialize( - this, - Array.isArray(data) ? data : [], - 0, - -1, - [], - this.#one_of_decls - ); - if (!Array.isArray(data) && typeof data == 'object') { - if ('common' in data && data.common != undefined) { - this.common = data.common; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("common" in data && data.common != undefined) { + this.common = data.common; + } + if ("code" in data && data.code != undefined) { + this.code = data.code; + } + if ("lineWidth" in data && data.lineWidth != undefined) { + this.lineWidth = data.lineWidth; + } + if ("lineColor" in data && data.lineColor != undefined) { + this.lineColor = data.lineColor; + } + if ("width" in data && data.width != undefined) { + this.width = data.width; + } + if ("height" in data && data.height != undefined) { + this.height = data.height; + } + if ("radius" in data && data.radius != undefined) { + this.radius = data.radius; + } + if ("point" in data && data.point != undefined) { + this.point = data.point; + } + } } - if ('code' in data && data.code != undefined) { - this.code = data.code; + get common() { + return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; } - if ('lineWidth' in data && data.lineWidth != undefined) { - this.lineWidth = data.lineWidth; + set common(value: CommonInfo) { + pb_1.Message.setWrapperField(this, 1, value); } - if ('lineColor' in data && data.lineColor != undefined) { - this.lineColor = data.lineColor; + get has_common() { + return pb_1.Message.getField(this, 1) != null; } - if ('width' in data && data.width != undefined) { - this.width = data.width; + get code() { + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; } - if ('height' in data && data.height != undefined) { - this.height = data.height; + set code(value: string) { + pb_1.Message.setField(this, 2, value); } - if ('radius' in data && data.radius != undefined) { - this.radius = data.radius; + get lineWidth() { + return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; } - if ('point' in data && data.point != undefined) { - this.point = data.point; + set lineWidth(value: number) { + pb_1.Message.setField(this, 3, value); } - } - } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; - } - set common(value: CommonInfo) { - pb_1.Message.setWrapperField(this, 1, value); - } - get has_common() { - return pb_1.Message.getField(this, 1) != null; - } - get code() { - return pb_1.Message.getFieldWithDefault(this, 2, '') as string; - } - set code(value: string) { - pb_1.Message.setField(this, 2, value); - } - get lineWidth() { - return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; - } - set lineWidth(value: number) { - pb_1.Message.setField(this, 3, value); - } - get lineColor() { - return pb_1.Message.getFieldWithDefault(this, 4, '') as string; - } - set lineColor(value: string) { - pb_1.Message.setField(this, 4, value); - } - get width() { - return pb_1.Message.getFieldWithDefault(this, 5, 0) as number; - } - set width(value: number) { - pb_1.Message.setField(this, 5, value); - } - get height() { - return pb_1.Message.getFieldWithDefault(this, 6, 0) as number; - } - set height(value: number) { - pb_1.Message.setField(this, 6, value); - } - get radius() { - return pb_1.Message.getFieldWithDefault(this, 7, 0) as number; - } - set radius(value: number) { - pb_1.Message.setField(this, 7, value); - } - get point() { - return pb_1.Message.getWrapperField(this, Point, 8) as Point; - } - set point(value: Point) { - pb_1.Message.setWrapperField(this, 8, value); - } - get has_point() { - return pb_1.Message.getField(this, 8) != null; - } - static fromObject(data: { - common?: ReturnType; - code?: string; - lineWidth?: number; - lineColor?: string; - width?: number; - height?: number; - radius?: number; - point?: ReturnType; - }): Rect { - const message = new Rect({}); - if (data.common != null) { - message.common = CommonInfo.fromObject(data.common); - } - if (data.code != null) { - message.code = data.code; - } - if (data.lineWidth != null) { - message.lineWidth = data.lineWidth; - } - if (data.lineColor != null) { - message.lineColor = data.lineColor; - } - if (data.width != null) { - message.width = data.width; - } - if (data.height != null) { - message.height = data.height; - } - if (data.radius != null) { - message.radius = data.radius; - } - if (data.point != null) { - message.point = Point.fromObject(data.point); - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - lineWidth?: number; - lineColor?: string; - width?: number; - height?: number; - radius?: number; - point?: ReturnType; - } = {}; - if (this.common != null) { - data.common = this.common.toObject(); - } - if (this.code != null) { - data.code = this.code; - } - if (this.lineWidth != null) { - data.lineWidth = this.lineWidth; - } - if (this.lineColor != null) { - data.lineColor = this.lineColor; - } - if (this.width != null) { - data.width = this.width; - } - if (this.height != null) { - data.height = this.height; - } - if (this.radius != null) { - data.radius = this.radius; - } - if (this.point != null) { - data.point = this.point.toObject(); - } - return data; - } - serialize(): Uint8Array; - serialize(w: pb_1.BinaryWriter): void; - serialize(w?: pb_1.BinaryWriter): Uint8Array | void { - const writer = w || new pb_1.BinaryWriter(); - if (this.has_common) - writer.writeMessage(1, this.common, () => - this.common.serialize(writer) - ); - if (this.code.length) writer.writeString(2, this.code); - if (this.lineWidth != 0) writer.writeInt32(3, this.lineWidth); - if (this.lineColor.length) writer.writeString(4, this.lineColor); - if (this.width != 0) writer.writeFloat(5, this.width); - if (this.height != 0) writer.writeFloat(6, this.height); - if (this.radius != 0) writer.writeInt32(7, this.radius); - if (this.has_point) - writer.writeMessage(8, this.point, () => this.point.serialize(writer)); - if (!w) return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Rect { - const reader = - bytes instanceof pb_1.BinaryReader - ? bytes - : new pb_1.BinaryReader(bytes), - message = new Rect(); - while (reader.nextField()) { - if (reader.isEndGroup()) break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage( - message.common, - () => (message.common = CommonInfo.deserialize(reader)) - ); - break; - case 2: - message.code = reader.readString(); - break; - case 3: - message.lineWidth = reader.readInt32(); - break; - case 4: - message.lineColor = reader.readString(); - break; - case 5: - message.width = reader.readFloat(); - break; - case 6: - message.height = reader.readFloat(); - break; - case 7: - message.radius = reader.readInt32(); - break; - case 8: - reader.readMessage( - message.point, - () => (message.point = Point.deserialize(reader)) - ); - break; - default: - reader.skipField(); + get lineColor() { + return pb_1.Message.getFieldWithDefault(this, 4, "") as string; + } + set lineColor(value: string) { + pb_1.Message.setField(this, 4, value); + } + get width() { + return pb_1.Message.getFieldWithDefault(this, 5, 0) as number; + } + set width(value: number) { + pb_1.Message.setField(this, 5, value); + } + get height() { + return pb_1.Message.getFieldWithDefault(this, 6, 0) as number; + } + set height(value: number) { + pb_1.Message.setField(this, 6, value); + } + get radius() { + return pb_1.Message.getFieldWithDefault(this, 7, 0) as number; + } + set radius(value: number) { + pb_1.Message.setField(this, 7, value); + } + get point() { + return pb_1.Message.getWrapperField(this, Point, 8) as Point; + } + set point(value: Point) { + pb_1.Message.setWrapperField(this, 8, value); + } + get has_point() { + return pb_1.Message.getField(this, 8) != null; + } + static fromObject(data: { + common?: ReturnType; + code?: string; + lineWidth?: number; + lineColor?: string; + width?: number; + height?: number; + radius?: number; + point?: ReturnType; + }): Rect { + const message = new Rect({}); + if (data.common != null) { + message.common = CommonInfo.fromObject(data.common); + } + if (data.code != null) { + message.code = data.code; + } + if (data.lineWidth != null) { + message.lineWidth = data.lineWidth; + } + if (data.lineColor != null) { + message.lineColor = data.lineColor; + } + if (data.width != null) { + message.width = data.width; + } + if (data.height != null) { + message.height = data.height; + } + if (data.radius != null) { + message.radius = data.radius; + } + if (data.point != null) { + message.point = Point.fromObject(data.point); + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + lineWidth?: number; + lineColor?: string; + width?: number; + height?: number; + radius?: number; + point?: ReturnType; + } = {}; + if (this.common != null) { + data.common = this.common.toObject(); + } + if (this.code != null) { + data.code = this.code; + } + if (this.lineWidth != null) { + data.lineWidth = this.lineWidth; + } + if (this.lineColor != null) { + data.lineColor = this.lineColor; + } + if (this.width != null) { + data.width = this.width; + } + if (this.height != null) { + data.height = this.height; + } + if (this.radius != null) { + data.radius = this.radius; + } + if (this.point != null) { + data.point = this.point.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.has_common) + writer.writeMessage(1, this.common, () => this.common.serialize(writer)); + if (this.code.length) + writer.writeString(2, this.code); + if (this.lineWidth != 0) + writer.writeInt32(3, this.lineWidth); + if (this.lineColor.length) + writer.writeString(4, this.lineColor); + if (this.width != 0) + writer.writeFloat(5, this.width); + if (this.height != 0) + writer.writeFloat(6, this.height); + if (this.radius != 0) + writer.writeInt32(7, this.radius); + if (this.has_point) + writer.writeMessage(8, this.point, () => this.point.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Rect { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Rect(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.common, () => message.common = CommonInfo.deserialize(reader)); + break; + case 2: + message.code = reader.readString(); + break; + case 3: + message.lineWidth = reader.readInt32(); + break; + case 4: + message.lineColor = reader.readString(); + break; + case 5: + message.width = reader.readFloat(); + break; + case 6: + message.height = reader.readFloat(); + break; + case 7: + message.radius = reader.readInt32(); + break; + case 8: + reader.readMessage(message.point, () => message.point = Point.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Rect { + return Rect.deserialize(bytes); } - } - return message; } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): Rect { - return Rect.deserialize(bytes); - } - } - export class Platform extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor( - data?: - | any[] - | { + export class Platform extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { common?: CommonInfo; code?: string; hasdoor?: boolean; direction?: string; - } - ) { - super(); - pb_1.Message.initialize( - this, - Array.isArray(data) ? data : [], - 0, - -1, - [], - this.#one_of_decls - ); - if (!Array.isArray(data) && typeof data == 'object') { - if ('common' in data && data.common != undefined) { - this.common = data.common; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("common" in data && data.common != undefined) { + this.common = data.common; + } + if ("code" in data && data.code != undefined) { + this.code = data.code; + } + if ("hasdoor" in data && data.hasdoor != undefined) { + this.hasdoor = data.hasdoor; + } + if ("direction" in data && data.direction != undefined) { + this.direction = data.direction; + } + } } - if ('code' in data && data.code != undefined) { - this.code = data.code; + get common() { + return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; } - if ('hasdoor' in data && data.hasdoor != undefined) { - this.hasdoor = data.hasdoor; + set common(value: CommonInfo) { + pb_1.Message.setWrapperField(this, 1, value); } - if ('direction' in data && data.direction != undefined) { - this.direction = data.direction; + get has_common() { + return pb_1.Message.getField(this, 1) != null; } - } - } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; - } - set common(value: CommonInfo) { - pb_1.Message.setWrapperField(this, 1, value); - } - get has_common() { - return pb_1.Message.getField(this, 1) != null; - } - get code() { - return pb_1.Message.getFieldWithDefault(this, 2, '') as string; - } - set code(value: string) { - pb_1.Message.setField(this, 2, value); - } - get hasdoor() { - return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean; - } - set hasdoor(value: boolean) { - pb_1.Message.setField(this, 3, value); - } - get direction() { - return pb_1.Message.getFieldWithDefault(this, 4, '') as string; - } - set direction(value: string) { - pb_1.Message.setField(this, 4, value); - } - static fromObject(data: { - common?: ReturnType; - code?: string; - hasdoor?: boolean; - direction?: string; - }): Platform { - const message = new Platform({}); - if (data.common != null) { - message.common = CommonInfo.fromObject(data.common); - } - if (data.code != null) { - message.code = data.code; - } - if (data.hasdoor != null) { - message.hasdoor = data.hasdoor; - } - if (data.direction != null) { - message.direction = data.direction; - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - hasdoor?: boolean; - direction?: string; - } = {}; - if (this.common != null) { - data.common = this.common.toObject(); - } - if (this.code != null) { - data.code = this.code; - } - if (this.hasdoor != null) { - data.hasdoor = this.hasdoor; - } - if (this.direction != null) { - data.direction = this.direction; - } - return data; - } - serialize(): Uint8Array; - serialize(w: pb_1.BinaryWriter): void; - serialize(w?: pb_1.BinaryWriter): Uint8Array | void { - const writer = w || new pb_1.BinaryWriter(); - if (this.has_common) - writer.writeMessage(1, this.common, () => - this.common.serialize(writer) - ); - if (this.code.length) writer.writeString(2, this.code); - if (this.hasdoor != false) writer.writeBool(3, this.hasdoor); - if (this.direction.length) writer.writeString(4, this.direction); - if (!w) return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Platform { - const reader = - bytes instanceof pb_1.BinaryReader - ? bytes - : new pb_1.BinaryReader(bytes), - message = new Platform(); - while (reader.nextField()) { - if (reader.isEndGroup()) break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage( - message.common, - () => (message.common = CommonInfo.deserialize(reader)) - ); - break; - case 2: - message.code = reader.readString(); - break; - case 3: - message.hasdoor = reader.readBool(); - break; - case 4: - message.direction = reader.readString(); - break; - default: - reader.skipField(); + get code() { + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; + } + set code(value: string) { + pb_1.Message.setField(this, 2, value); + } + get hasdoor() { + return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean; + } + set hasdoor(value: boolean) { + pb_1.Message.setField(this, 3, value); + } + get direction() { + return pb_1.Message.getFieldWithDefault(this, 4, "") as string; + } + set direction(value: string) { + pb_1.Message.setField(this, 4, value); + } + static fromObject(data: { + common?: ReturnType; + code?: string; + hasdoor?: boolean; + direction?: string; + }): Platform { + const message = new Platform({}); + if (data.common != null) { + message.common = CommonInfo.fromObject(data.common); + } + if (data.code != null) { + message.code = data.code; + } + if (data.hasdoor != null) { + message.hasdoor = data.hasdoor; + } + if (data.direction != null) { + message.direction = data.direction; + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + hasdoor?: boolean; + direction?: string; + } = {}; + if (this.common != null) { + data.common = this.common.toObject(); + } + if (this.code != null) { + data.code = this.code; + } + if (this.hasdoor != null) { + data.hasdoor = this.hasdoor; + } + if (this.direction != null) { + data.direction = this.direction; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.has_common) + writer.writeMessage(1, this.common, () => this.common.serialize(writer)); + if (this.code.length) + writer.writeString(2, this.code); + if (this.hasdoor != false) + writer.writeBool(3, this.hasdoor); + if (this.direction.length) + writer.writeString(4, this.direction); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Platform { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Platform(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.common, () => message.common = CommonInfo.deserialize(reader)); + break; + case 2: + message.code = reader.readString(); + break; + case 3: + message.hasdoor = reader.readBool(); + break; + case 4: + message.direction = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Platform { + return Platform.deserialize(bytes); } - } - return message; } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): Platform { - return Platform.deserialize(bytes); - } - } - export class Station extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor( - data?: - | any[] - | { + export class Station extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { common?: CommonInfo; code?: string; - } - ) { - super(); - pb_1.Message.initialize( - this, - Array.isArray(data) ? data : [], - 0, - -1, - [], - this.#one_of_decls - ); - if (!Array.isArray(data) && typeof data == 'object') { - if ('common' in data && data.common != undefined) { - this.common = data.common; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("common" in data && data.common != undefined) { + this.common = data.common; + } + if ("code" in data && data.code != undefined) { + this.code = data.code; + } + } } - if ('code' in data && data.code != undefined) { - this.code = data.code; + get common() { + return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; } - } - } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; - } - set common(value: CommonInfo) { - pb_1.Message.setWrapperField(this, 1, value); - } - get has_common() { - return pb_1.Message.getField(this, 1) != null; - } - get code() { - return pb_1.Message.getFieldWithDefault(this, 2, '') as string; - } - set code(value: string) { - pb_1.Message.setField(this, 2, value); - } - static fromObject(data: { - common?: ReturnType; - code?: string; - }): Station { - const message = new Station({}); - if (data.common != null) { - message.common = CommonInfo.fromObject(data.common); - } - if (data.code != null) { - message.code = data.code; - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - } = {}; - if (this.common != null) { - data.common = this.common.toObject(); - } - if (this.code != null) { - data.code = this.code; - } - return data; - } - serialize(): Uint8Array; - serialize(w: pb_1.BinaryWriter): void; - serialize(w?: pb_1.BinaryWriter): Uint8Array | void { - const writer = w || new pb_1.BinaryWriter(); - if (this.has_common) - writer.writeMessage(1, this.common, () => - this.common.serialize(writer) - ); - if (this.code.length) writer.writeString(2, this.code); - if (!w) return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Station { - const reader = - bytes instanceof pb_1.BinaryReader - ? bytes - : new pb_1.BinaryReader(bytes), - message = new Station(); - while (reader.nextField()) { - if (reader.isEndGroup()) break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage( - message.common, - () => (message.common = CommonInfo.deserialize(reader)) - ); - break; - case 2: - message.code = reader.readString(); - break; - default: - reader.skipField(); + set common(value: CommonInfo) { + pb_1.Message.setWrapperField(this, 1, value); + } + get has_common() { + return pb_1.Message.getField(this, 1) != null; + } + get code() { + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; + } + set code(value: string) { + pb_1.Message.setField(this, 2, value); + } + static fromObject(data: { + common?: ReturnType; + code?: string; + }): Station { + const message = new Station({}); + if (data.common != null) { + message.common = CommonInfo.fromObject(data.common); + } + if (data.code != null) { + message.code = data.code; + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + } = {}; + if (this.common != null) { + data.common = this.common.toObject(); + } + if (this.code != null) { + data.code = this.code; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.has_common) + writer.writeMessage(1, this.common, () => this.common.serialize(writer)); + if (this.code.length) + writer.writeString(2, this.code); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Station { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Station(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.common, () => message.common = CommonInfo.deserialize(reader)); + break; + case 2: + message.code = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Station { + return Station.deserialize(bytes); } - } - return message; } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): Station { - return Station.deserialize(bytes); - } - } - export class StationLine extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor( - data?: - | any[] - | { + export class StationLine extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { common?: CommonInfo; code?: string; hasTransfer?: boolean; - } - ) { - super(); - pb_1.Message.initialize( - this, - Array.isArray(data) ? data : [], - 0, - -1, - [], - this.#one_of_decls - ); - if (!Array.isArray(data) && typeof data == 'object') { - if ('common' in data && data.common != undefined) { - this.common = data.common; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("common" in data && data.common != undefined) { + this.common = data.common; + } + if ("code" in data && data.code != undefined) { + this.code = data.code; + } + if ("hasTransfer" in data && data.hasTransfer != undefined) { + this.hasTransfer = data.hasTransfer; + } + } } - if ('code' in data && data.code != undefined) { - this.code = data.code; + get common() { + return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; } - if ('hasTransfer' in data && data.hasTransfer != undefined) { - this.hasTransfer = data.hasTransfer; + set common(value: CommonInfo) { + pb_1.Message.setWrapperField(this, 1, value); } - } - } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; - } - set common(value: CommonInfo) { - pb_1.Message.setWrapperField(this, 1, value); - } - get has_common() { - return pb_1.Message.getField(this, 1) != null; - } - get code() { - return pb_1.Message.getFieldWithDefault(this, 2, '') as string; - } - set code(value: string) { - pb_1.Message.setField(this, 2, value); - } - get hasTransfer() { - return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean; - } - set hasTransfer(value: boolean) { - pb_1.Message.setField(this, 3, value); - } - static fromObject(data: { - common?: ReturnType; - code?: string; - hasTransfer?: boolean; - }): StationLine { - const message = new StationLine({}); - if (data.common != null) { - message.common = CommonInfo.fromObject(data.common); - } - if (data.code != null) { - message.code = data.code; - } - if (data.hasTransfer != null) { - message.hasTransfer = data.hasTransfer; - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - hasTransfer?: boolean; - } = {}; - if (this.common != null) { - data.common = this.common.toObject(); - } - if (this.code != null) { - data.code = this.code; - } - if (this.hasTransfer != null) { - data.hasTransfer = this.hasTransfer; - } - return data; - } - serialize(): Uint8Array; - serialize(w: pb_1.BinaryWriter): void; - serialize(w?: pb_1.BinaryWriter): Uint8Array | void { - const writer = w || new pb_1.BinaryWriter(); - if (this.has_common) - writer.writeMessage(1, this.common, () => - this.common.serialize(writer) - ); - if (this.code.length) writer.writeString(2, this.code); - if (this.hasTransfer != false) writer.writeBool(3, this.hasTransfer); - if (!w) return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): StationLine { - const reader = - bytes instanceof pb_1.BinaryReader - ? bytes - : new pb_1.BinaryReader(bytes), - message = new StationLine(); - while (reader.nextField()) { - if (reader.isEndGroup()) break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage( - message.common, - () => (message.common = CommonInfo.deserialize(reader)) - ); - break; - case 2: - message.code = reader.readString(); - break; - case 3: - message.hasTransfer = reader.readBool(); - break; - default: - reader.skipField(); + get has_common() { + return pb_1.Message.getField(this, 1) != null; + } + get code() { + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; + } + set code(value: string) { + pb_1.Message.setField(this, 2, value); + } + get hasTransfer() { + return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean; + } + set hasTransfer(value: boolean) { + pb_1.Message.setField(this, 3, value); + } + static fromObject(data: { + common?: ReturnType; + code?: string; + hasTransfer?: boolean; + }): StationLine { + const message = new StationLine({}); + if (data.common != null) { + message.common = CommonInfo.fromObject(data.common); + } + if (data.code != null) { + message.code = data.code; + } + if (data.hasTransfer != null) { + message.hasTransfer = data.hasTransfer; + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + hasTransfer?: boolean; + } = {}; + if (this.common != null) { + data.common = this.common.toObject(); + } + if (this.code != null) { + data.code = this.code; + } + if (this.hasTransfer != null) { + data.hasTransfer = this.hasTransfer; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.has_common) + writer.writeMessage(1, this.common, () => this.common.serialize(writer)); + if (this.code.length) + writer.writeString(2, this.code); + if (this.hasTransfer != false) + writer.writeBool(3, this.hasTransfer); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): StationLine { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new StationLine(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.common, () => message.common = CommonInfo.deserialize(reader)); + break; + case 2: + message.code = reader.readString(); + break; + case 3: + message.hasTransfer = reader.readBool(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): StationLine { + return StationLine.deserialize(bytes); } - } - return message; } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): StationLine { - return StationLine.deserialize(bytes); - } - } - export class Train extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor( - data?: - | any[] - | { + export class Train extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { common?: CommonInfo; code?: string; trainDirection?: string; hasBorder?: boolean; - } - ) { - super(); - pb_1.Message.initialize( - this, - Array.isArray(data) ? data : [], - 0, - -1, - [], - this.#one_of_decls - ); - if (!Array.isArray(data) && typeof data == 'object') { - if ('common' in data && data.common != undefined) { - this.common = data.common; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("common" in data && data.common != undefined) { + this.common = data.common; + } + if ("code" in data && data.code != undefined) { + this.code = data.code; + } + if ("trainDirection" in data && data.trainDirection != undefined) { + this.trainDirection = data.trainDirection; + } + if ("hasBorder" in data && data.hasBorder != undefined) { + this.hasBorder = data.hasBorder; + } + } } - if ('code' in data && data.code != undefined) { - this.code = data.code; + get common() { + return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; } - if ('trainDirection' in data && data.trainDirection != undefined) { - this.trainDirection = data.trainDirection; + set common(value: CommonInfo) { + pb_1.Message.setWrapperField(this, 1, value); } - if ('hasBorder' in data && data.hasBorder != undefined) { - this.hasBorder = data.hasBorder; + get has_common() { + return pb_1.Message.getField(this, 1) != null; } - } - } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; - } - set common(value: CommonInfo) { - pb_1.Message.setWrapperField(this, 1, value); - } - get has_common() { - return pb_1.Message.getField(this, 1) != null; - } - get code() { - return pb_1.Message.getFieldWithDefault(this, 2, '') as string; - } - set code(value: string) { - pb_1.Message.setField(this, 2, value); - } - get trainDirection() { - return pb_1.Message.getFieldWithDefault(this, 3, '') as string; - } - set trainDirection(value: string) { - pb_1.Message.setField(this, 3, value); - } - get hasBorder() { - return pb_1.Message.getFieldWithDefault(this, 4, false) as boolean; - } - set hasBorder(value: boolean) { - pb_1.Message.setField(this, 4, value); - } - static fromObject(data: { - common?: ReturnType; - code?: string; - trainDirection?: string; - hasBorder?: boolean; - }): Train { - const message = new Train({}); - if (data.common != null) { - message.common = CommonInfo.fromObject(data.common); - } - if (data.code != null) { - message.code = data.code; - } - if (data.trainDirection != null) { - message.trainDirection = data.trainDirection; - } - if (data.hasBorder != null) { - message.hasBorder = data.hasBorder; - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - trainDirection?: string; - hasBorder?: boolean; - } = {}; - if (this.common != null) { - data.common = this.common.toObject(); - } - if (this.code != null) { - data.code = this.code; - } - if (this.trainDirection != null) { - data.trainDirection = this.trainDirection; - } - if (this.hasBorder != null) { - data.hasBorder = this.hasBorder; - } - return data; - } - serialize(): Uint8Array; - serialize(w: pb_1.BinaryWriter): void; - serialize(w?: pb_1.BinaryWriter): Uint8Array | void { - const writer = w || new pb_1.BinaryWriter(); - if (this.has_common) - writer.writeMessage(1, this.common, () => - this.common.serialize(writer) - ); - if (this.code.length) writer.writeString(2, this.code); - if (this.trainDirection.length) - writer.writeString(3, this.trainDirection); - if (this.hasBorder != false) writer.writeBool(4, this.hasBorder); - if (!w) return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Train { - const reader = - bytes instanceof pb_1.BinaryReader - ? bytes - : new pb_1.BinaryReader(bytes), - message = new Train(); - while (reader.nextField()) { - if (reader.isEndGroup()) break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage( - message.common, - () => (message.common = CommonInfo.deserialize(reader)) - ); - break; - case 2: - message.code = reader.readString(); - break; - case 3: - message.trainDirection = reader.readString(); - break; - case 4: - message.hasBorder = reader.readBool(); - break; - default: - reader.skipField(); + get code() { + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; + } + set code(value: string) { + pb_1.Message.setField(this, 2, value); + } + get trainDirection() { + return pb_1.Message.getFieldWithDefault(this, 3, "") as string; + } + set trainDirection(value: string) { + pb_1.Message.setField(this, 3, value); + } + get hasBorder() { + return pb_1.Message.getFieldWithDefault(this, 4, false) as boolean; + } + set hasBorder(value: boolean) { + pb_1.Message.setField(this, 4, value); + } + static fromObject(data: { + common?: ReturnType; + code?: string; + trainDirection?: string; + hasBorder?: boolean; + }): Train { + const message = new Train({}); + if (data.common != null) { + message.common = CommonInfo.fromObject(data.common); + } + if (data.code != null) { + message.code = data.code; + } + if (data.trainDirection != null) { + message.trainDirection = data.trainDirection; + } + if (data.hasBorder != null) { + message.hasBorder = data.hasBorder; + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + trainDirection?: string; + hasBorder?: boolean; + } = {}; + if (this.common != null) { + data.common = this.common.toObject(); + } + if (this.code != null) { + data.code = this.code; + } + if (this.trainDirection != null) { + data.trainDirection = this.trainDirection; + } + if (this.hasBorder != null) { + data.hasBorder = this.hasBorder; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.has_common) + writer.writeMessage(1, this.common, () => this.common.serialize(writer)); + if (this.code.length) + writer.writeString(2, this.code); + if (this.trainDirection.length) + writer.writeString(3, this.trainDirection); + if (this.hasBorder != false) + writer.writeBool(4, this.hasBorder); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Train { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Train(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.common, () => message.common = CommonInfo.deserialize(reader)); + break; + case 2: + message.code = reader.readString(); + break; + case 3: + message.trainDirection = reader.readString(); + break; + case 4: + message.hasBorder = reader.readBool(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Train { + return Train.deserialize(bytes); } - } - return message; } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): Train { - return Train.deserialize(bytes); - } - } - export class IscsFan extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor( - data?: - | any[] - | { + export class TrainLine extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { common?: CommonInfo; code?: string; - } - ) { - super(); - pb_1.Message.initialize( - this, - Array.isArray(data) ? data : [], - 0, - -1, - [], - this.#one_of_decls - ); - if (!Array.isArray(data) && typeof data == 'object') { - if ('common' in data && data.common != undefined) { - this.common = data.common; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("common" in data && data.common != undefined) { + this.common = data.common; + } + if ("code" in data && data.code != undefined) { + this.code = data.code; + } + } } - if ('code' in data && data.code != undefined) { - this.code = data.code; + get common() { + return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; } - } - } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; - } - set common(value: CommonInfo) { - pb_1.Message.setWrapperField(this, 1, value); - } - get has_common() { - return pb_1.Message.getField(this, 1) != null; - } - get code() { - return pb_1.Message.getFieldWithDefault(this, 2, '') as string; - } - set code(value: string) { - pb_1.Message.setField(this, 2, value); - } - static fromObject(data: { - common?: ReturnType; - code?: string; - }): IscsFan { - const message = new IscsFan({}); - if (data.common != null) { - message.common = CommonInfo.fromObject(data.common); - } - if (data.code != null) { - message.code = data.code; - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - } = {}; - if (this.common != null) { - data.common = this.common.toObject(); - } - if (this.code != null) { - data.code = this.code; - } - return data; - } - serialize(): Uint8Array; - serialize(w: pb_1.BinaryWriter): void; - serialize(w?: pb_1.BinaryWriter): Uint8Array | void { - const writer = w || new pb_1.BinaryWriter(); - if (this.has_common) - writer.writeMessage(1, this.common, () => - this.common.serialize(writer) - ); - if (this.code.length) writer.writeString(2, this.code); - if (!w) return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): IscsFan { - const reader = - bytes instanceof pb_1.BinaryReader - ? bytes - : new pb_1.BinaryReader(bytes), - message = new IscsFan(); - while (reader.nextField()) { - if (reader.isEndGroup()) break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage( - message.common, - () => (message.common = CommonInfo.deserialize(reader)) - ); - break; - case 2: - message.code = reader.readString(); - break; - default: - reader.skipField(); + set common(value: CommonInfo) { + pb_1.Message.setWrapperField(this, 1, value); + } + get has_common() { + return pb_1.Message.getField(this, 1) != null; + } + get code() { + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; + } + set code(value: string) { + pb_1.Message.setField(this, 2, value); + } + static fromObject(data: { + common?: ReturnType; + code?: string; + }): TrainLine { + const message = new TrainLine({}); + if (data.common != null) { + message.common = CommonInfo.fromObject(data.common); + } + if (data.code != null) { + message.code = data.code; + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + } = {}; + if (this.common != null) { + data.common = this.common.toObject(); + } + if (this.code != null) { + data.code = this.code; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.has_common) + writer.writeMessage(1, this.common, () => this.common.serialize(writer)); + if (this.code.length) + writer.writeString(2, this.code); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): TrainLine { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new TrainLine(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.common, () => message.common = CommonInfo.deserialize(reader)); + break; + case 2: + message.code = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): TrainLine { + return TrainLine.deserialize(bytes); } - } - return message; } - serializeBinary(): Uint8Array { - return this.serialize(); + export class IscsFan extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + common?: CommonInfo; + code?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("common" in data && data.common != undefined) { + this.common = data.common; + } + if ("code" in data && data.code != undefined) { + this.code = data.code; + } + } + } + get common() { + return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; + } + set common(value: CommonInfo) { + pb_1.Message.setWrapperField(this, 1, value); + } + get has_common() { + return pb_1.Message.getField(this, 1) != null; + } + get code() { + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; + } + set code(value: string) { + pb_1.Message.setField(this, 2, value); + } + static fromObject(data: { + common?: ReturnType; + code?: string; + }): IscsFan { + const message = new IscsFan({}); + if (data.common != null) { + message.common = CommonInfo.fromObject(data.common); + } + if (data.code != null) { + message.code = data.code; + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + } = {}; + if (this.common != null) { + data.common = this.common.toObject(); + } + if (this.code != null) { + data.code = this.code; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.has_common) + writer.writeMessage(1, this.common, () => this.common.serialize(writer)); + if (this.code.length) + writer.writeString(2, this.code); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): IscsFan { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new IscsFan(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.common, () => message.common = CommonInfo.deserialize(reader)); + break; + case 2: + message.code = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): IscsFan { + return IscsFan.deserialize(bytes); + } } - static deserializeBinary(bytes: Uint8Array): IscsFan { - return IscsFan.deserialize(bytes); - } - } - export class Turnout extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor( - data?: - | any[] - | { + export class Turnout extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { common?: CommonInfo; code?: string; pointA?: Point; pointB?: Point; pointC?: Point; labelOffset?: Point; - } - ) { - super(); - pb_1.Message.initialize( - this, - Array.isArray(data) ? data : [], - 0, - -1, - [], - this.#one_of_decls - ); - if (!Array.isArray(data) && typeof data == 'object') { - if ('common' in data && data.common != undefined) { - this.common = data.common; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("common" in data && data.common != undefined) { + this.common = data.common; + } + if ("code" in data && data.code != undefined) { + this.code = data.code; + } + if ("pointA" in data && data.pointA != undefined) { + this.pointA = data.pointA; + } + if ("pointB" in data && data.pointB != undefined) { + this.pointB = data.pointB; + } + if ("pointC" in data && data.pointC != undefined) { + this.pointC = data.pointC; + } + if ("labelOffset" in data && data.labelOffset != undefined) { + this.labelOffset = data.labelOffset; + } + } } - if ('code' in data && data.code != undefined) { - this.code = data.code; + get common() { + return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; } - if ('pointA' in data && data.pointA != undefined) { - this.pointA = data.pointA; + set common(value: CommonInfo) { + pb_1.Message.setWrapperField(this, 1, value); } - if ('pointB' in data && data.pointB != undefined) { - this.pointB = data.pointB; + get has_common() { + return pb_1.Message.getField(this, 1) != null; } - if ('pointC' in data && data.pointC != undefined) { - this.pointC = data.pointC; + get code() { + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; } - if ('labelOffset' in data && data.labelOffset != undefined) { - this.labelOffset = data.labelOffset; + set code(value: string) { + pb_1.Message.setField(this, 2, value); } - } - } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; - } - set common(value: CommonInfo) { - pb_1.Message.setWrapperField(this, 1, value); - } - get has_common() { - return pb_1.Message.getField(this, 1) != null; - } - get code() { - return pb_1.Message.getFieldWithDefault(this, 2, '') as string; - } - set code(value: string) { - pb_1.Message.setField(this, 2, value); - } - get pointA() { - return pb_1.Message.getWrapperField(this, Point, 6) as Point; - } - set pointA(value: Point) { - pb_1.Message.setWrapperField(this, 6, value); - } - get has_pointA() { - return pb_1.Message.getField(this, 6) != null; - } - get pointB() { - return pb_1.Message.getWrapperField(this, Point, 7) as Point; - } - set pointB(value: Point) { - pb_1.Message.setWrapperField(this, 7, value); - } - get has_pointB() { - return pb_1.Message.getField(this, 7) != null; - } - get pointC() { - return pb_1.Message.getWrapperField(this, Point, 8) as Point; - } - set pointC(value: Point) { - pb_1.Message.setWrapperField(this, 8, value); - } - get has_pointC() { - return pb_1.Message.getField(this, 8) != null; - } - get labelOffset() { - return pb_1.Message.getWrapperField(this, Point, 9) as Point; - } - set labelOffset(value: Point) { - pb_1.Message.setWrapperField(this, 9, value); - } - get has_labelOffset() { - return pb_1.Message.getField(this, 9) != null; - } - static fromObject(data: { - common?: ReturnType; - code?: string; - pointA?: ReturnType; - pointB?: ReturnType; - pointC?: ReturnType; - labelOffset?: ReturnType; - }): Turnout { - const message = new Turnout({}); - if (data.common != null) { - message.common = CommonInfo.fromObject(data.common); - } - if (data.code != null) { - message.code = data.code; - } - if (data.pointA != null) { - message.pointA = Point.fromObject(data.pointA); - } - if (data.pointB != null) { - message.pointB = Point.fromObject(data.pointB); - } - if (data.pointC != null) { - message.pointC = Point.fromObject(data.pointC); - } - if (data.labelOffset != null) { - message.labelOffset = Point.fromObject(data.labelOffset); - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - pointA?: ReturnType; - pointB?: ReturnType; - pointC?: ReturnType; - labelOffset?: ReturnType; - } = {}; - if (this.common != null) { - data.common = this.common.toObject(); - } - if (this.code != null) { - data.code = this.code; - } - if (this.pointA != null) { - data.pointA = this.pointA.toObject(); - } - if (this.pointB != null) { - data.pointB = this.pointB.toObject(); - } - if (this.pointC != null) { - data.pointC = this.pointC.toObject(); - } - if (this.labelOffset != null) { - data.labelOffset = this.labelOffset.toObject(); - } - return data; - } - serialize(): Uint8Array; - serialize(w: pb_1.BinaryWriter): void; - serialize(w?: pb_1.BinaryWriter): Uint8Array | void { - const writer = w || new pb_1.BinaryWriter(); - if (this.has_common) - writer.writeMessage(1, this.common, () => - this.common.serialize(writer) - ); - if (this.code.length) writer.writeString(2, this.code); - if (this.has_pointA) - writer.writeMessage(6, this.pointA, () => - this.pointA.serialize(writer) - ); - if (this.has_pointB) - writer.writeMessage(7, this.pointB, () => - this.pointB.serialize(writer) - ); - if (this.has_pointC) - writer.writeMessage(8, this.pointC, () => - this.pointC.serialize(writer) - ); - if (this.has_labelOffset) - writer.writeMessage(9, this.labelOffset, () => - this.labelOffset.serialize(writer) - ); - if (!w) return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Turnout { - const reader = - bytes instanceof pb_1.BinaryReader - ? bytes - : new pb_1.BinaryReader(bytes), - message = new Turnout(); - while (reader.nextField()) { - if (reader.isEndGroup()) break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage( - message.common, - () => (message.common = CommonInfo.deserialize(reader)) - ); - break; - case 2: - message.code = reader.readString(); - break; - case 6: - reader.readMessage( - message.pointA, - () => (message.pointA = Point.deserialize(reader)) - ); - break; - case 7: - reader.readMessage( - message.pointB, - () => (message.pointB = Point.deserialize(reader)) - ); - break; - case 8: - reader.readMessage( - message.pointC, - () => (message.pointC = Point.deserialize(reader)) - ); - break; - case 9: - reader.readMessage( - message.labelOffset, - () => (message.labelOffset = Point.deserialize(reader)) - ); - break; - default: - reader.skipField(); + get pointA() { + return pb_1.Message.getWrapperField(this, Point, 6) as Point; + } + set pointA(value: Point) { + pb_1.Message.setWrapperField(this, 6, value); + } + get has_pointA() { + return pb_1.Message.getField(this, 6) != null; + } + get pointB() { + return pb_1.Message.getWrapperField(this, Point, 7) as Point; + } + set pointB(value: Point) { + pb_1.Message.setWrapperField(this, 7, value); + } + get has_pointB() { + return pb_1.Message.getField(this, 7) != null; + } + get pointC() { + return pb_1.Message.getWrapperField(this, Point, 8) as Point; + } + set pointC(value: Point) { + pb_1.Message.setWrapperField(this, 8, value); + } + get has_pointC() { + return pb_1.Message.getField(this, 8) != null; + } + get labelOffset() { + return pb_1.Message.getWrapperField(this, Point, 9) as Point; + } + set labelOffset(value: Point) { + pb_1.Message.setWrapperField(this, 9, value); + } + get has_labelOffset() { + return pb_1.Message.getField(this, 9) != null; + } + static fromObject(data: { + common?: ReturnType; + code?: string; + pointA?: ReturnType; + pointB?: ReturnType; + pointC?: ReturnType; + labelOffset?: ReturnType; + }): Turnout { + const message = new Turnout({}); + if (data.common != null) { + message.common = CommonInfo.fromObject(data.common); + } + if (data.code != null) { + message.code = data.code; + } + if (data.pointA != null) { + message.pointA = Point.fromObject(data.pointA); + } + if (data.pointB != null) { + message.pointB = Point.fromObject(data.pointB); + } + if (data.pointC != null) { + message.pointC = Point.fromObject(data.pointC); + } + if (data.labelOffset != null) { + message.labelOffset = Point.fromObject(data.labelOffset); + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + pointA?: ReturnType; + pointB?: ReturnType; + pointC?: ReturnType; + labelOffset?: ReturnType; + } = {}; + if (this.common != null) { + data.common = this.common.toObject(); + } + if (this.code != null) { + data.code = this.code; + } + if (this.pointA != null) { + data.pointA = this.pointA.toObject(); + } + if (this.pointB != null) { + data.pointB = this.pointB.toObject(); + } + if (this.pointC != null) { + data.pointC = this.pointC.toObject(); + } + if (this.labelOffset != null) { + data.labelOffset = this.labelOffset.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.has_common) + writer.writeMessage(1, this.common, () => this.common.serialize(writer)); + if (this.code.length) + writer.writeString(2, this.code); + if (this.has_pointA) + writer.writeMessage(6, this.pointA, () => this.pointA.serialize(writer)); + if (this.has_pointB) + writer.writeMessage(7, this.pointB, () => this.pointB.serialize(writer)); + if (this.has_pointC) + writer.writeMessage(8, this.pointC, () => this.pointC.serialize(writer)); + if (this.has_labelOffset) + writer.writeMessage(9, this.labelOffset, () => this.labelOffset.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Turnout { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Turnout(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.common, () => message.common = CommonInfo.deserialize(reader)); + break; + case 2: + message.code = reader.readString(); + break; + case 6: + reader.readMessage(message.pointA, () => message.pointA = Point.deserialize(reader)); + break; + case 7: + reader.readMessage(message.pointB, () => message.pointB = Point.deserialize(reader)); + break; + case 8: + reader.readMessage(message.pointC, () => message.pointC = Point.deserialize(reader)); + break; + case 9: + reader.readMessage(message.labelOffset, () => message.labelOffset = Point.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Turnout { + return Turnout.deserialize(bytes); } - } - return message; } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): Turnout { - return Turnout.deserialize(bytes); - } - } - export class Signal extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor( - data?: - | any[] - | { + export class Signal extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { common?: CommonInfo; code?: string; - } - ) { - super(); - pb_1.Message.initialize( - this, - Array.isArray(data) ? data : [], - 0, - -1, - [], - this.#one_of_decls - ); - if (!Array.isArray(data) && typeof data == 'object') { - if ('common' in data && data.common != undefined) { - this.common = data.common; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("common" in data && data.common != undefined) { + this.common = data.common; + } + if ("code" in data && data.code != undefined) { + this.code = data.code; + } + } } - if ('code' in data && data.code != undefined) { - this.code = data.code; + get common() { + return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; } - } - } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; - } - set common(value: CommonInfo) { - pb_1.Message.setWrapperField(this, 1, value); - } - get has_common() { - return pb_1.Message.getField(this, 1) != null; - } - get code() { - return pb_1.Message.getFieldWithDefault(this, 2, '') as string; - } - set code(value: string) { - pb_1.Message.setField(this, 2, value); - } - static fromObject(data: { - common?: ReturnType; - code?: string; - }): Signal { - const message = new Signal({}); - if (data.common != null) { - message.common = CommonInfo.fromObject(data.common); - } - if (data.code != null) { - message.code = data.code; - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - } = {}; - if (this.common != null) { - data.common = this.common.toObject(); - } - if (this.code != null) { - data.code = this.code; - } - return data; - } - serialize(): Uint8Array; - serialize(w: pb_1.BinaryWriter): void; - serialize(w?: pb_1.BinaryWriter): Uint8Array | void { - const writer = w || new pb_1.BinaryWriter(); - if (this.has_common) - writer.writeMessage(1, this.common, () => - this.common.serialize(writer) - ); - if (this.code.length) writer.writeString(2, this.code); - if (!w) return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Signal { - const reader = - bytes instanceof pb_1.BinaryReader - ? bytes - : new pb_1.BinaryReader(bytes), - message = new Signal(); - while (reader.nextField()) { - if (reader.isEndGroup()) break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage( - message.common, - () => (message.common = CommonInfo.deserialize(reader)) - ); - break; - case 2: - message.code = reader.readString(); - break; - default: - reader.skipField(); + set common(value: CommonInfo) { + pb_1.Message.setWrapperField(this, 1, value); + } + get has_common() { + return pb_1.Message.getField(this, 1) != null; + } + get code() { + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; + } + set code(value: string) { + pb_1.Message.setField(this, 2, value); + } + static fromObject(data: { + common?: ReturnType; + code?: string; + }): Signal { + const message = new Signal({}); + if (data.common != null) { + message.common = CommonInfo.fromObject(data.common); + } + if (data.code != null) { + message.code = data.code; + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + } = {}; + if (this.common != null) { + data.common = this.common.toObject(); + } + if (this.code != null) { + data.code = this.code; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.has_common) + writer.writeMessage(1, this.common, () => this.common.serialize(writer)); + if (this.code.length) + writer.writeString(2, this.code); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Signal { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Signal(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.common, () => message.common = CommonInfo.deserialize(reader)); + break; + case 2: + message.code = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Signal { + return Signal.deserialize(bytes); } - } - return message; } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): Signal { - return Signal.deserialize(bytes); - } - } - export class RunLine extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor( - data?: - | any[] - | { + export class RunLine extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { common?: CommonInfo; code?: string; points?: Point[]; nameColor?: string; nameBgColor?: string; - } - ) { - super(); - pb_1.Message.initialize( - this, - Array.isArray(data) ? data : [], - 0, - -1, - [3], - this.#one_of_decls - ); - if (!Array.isArray(data) && typeof data == 'object') { - if ('common' in data && data.common != undefined) { - this.common = data.common; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("common" in data && data.common != undefined) { + this.common = data.common; + } + if ("code" in data && data.code != undefined) { + this.code = data.code; + } + if ("points" in data && data.points != undefined) { + this.points = data.points; + } + if ("nameColor" in data && data.nameColor != undefined) { + this.nameColor = data.nameColor; + } + if ("nameBgColor" in data && data.nameBgColor != undefined) { + this.nameBgColor = data.nameBgColor; + } + } } - if ('code' in data && data.code != undefined) { - this.code = data.code; + get common() { + return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; } - if ('points' in data && data.points != undefined) { - this.points = data.points; + set common(value: CommonInfo) { + pb_1.Message.setWrapperField(this, 1, value); } - if ('nameColor' in data && data.nameColor != undefined) { - this.nameColor = data.nameColor; + get has_common() { + return pb_1.Message.getField(this, 1) != null; } - if ('nameBgColor' in data && data.nameBgColor != undefined) { - this.nameBgColor = data.nameBgColor; + get code() { + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; } - } - } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; - } - set common(value: CommonInfo) { - pb_1.Message.setWrapperField(this, 1, value); - } - get has_common() { - return pb_1.Message.getField(this, 1) != null; - } - get code() { - return pb_1.Message.getFieldWithDefault(this, 2, '') as string; - } - set code(value: string) { - pb_1.Message.setField(this, 2, value); - } - get points() { - return pb_1.Message.getRepeatedWrapperField(this, Point, 3) as Point[]; - } - set points(value: Point[]) { - pb_1.Message.setRepeatedWrapperField(this, 3, value); - } - get nameColor() { - return pb_1.Message.getFieldWithDefault(this, 4, '') as string; - } - set nameColor(value: string) { - pb_1.Message.setField(this, 4, value); - } - get nameBgColor() { - return pb_1.Message.getFieldWithDefault(this, 5, '') as string; - } - set nameBgColor(value: string) { - pb_1.Message.setField(this, 5, value); - } - static fromObject(data: { - common?: ReturnType; - code?: string; - points?: ReturnType[]; - nameColor?: string; - nameBgColor?: string; - }): RunLine { - const message = new RunLine({}); - if (data.common != null) { - message.common = CommonInfo.fromObject(data.common); - } - if (data.code != null) { - message.code = data.code; - } - if (data.points != null) { - message.points = data.points.map((item) => Point.fromObject(item)); - } - if (data.nameColor != null) { - message.nameColor = data.nameColor; - } - if (data.nameBgColor != null) { - message.nameBgColor = data.nameBgColor; - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - points?: ReturnType[]; - nameColor?: string; - nameBgColor?: string; - } = {}; - if (this.common != null) { - data.common = this.common.toObject(); - } - if (this.code != null) { - data.code = this.code; - } - if (this.points != null) { - data.points = this.points.map((item: Point) => item.toObject()); - } - if (this.nameColor != null) { - data.nameColor = this.nameColor; - } - if (this.nameBgColor != null) { - data.nameBgColor = this.nameBgColor; - } - return data; - } - serialize(): Uint8Array; - serialize(w: pb_1.BinaryWriter): void; - serialize(w?: pb_1.BinaryWriter): Uint8Array | void { - const writer = w || new pb_1.BinaryWriter(); - if (this.has_common) - writer.writeMessage(1, this.common, () => - this.common.serialize(writer) - ); - if (this.code.length) writer.writeString(2, this.code); - if (this.points.length) - writer.writeRepeatedMessage(3, this.points, (item: Point) => - item.serialize(writer) - ); - if (this.nameColor.length) writer.writeString(4, this.nameColor); - if (this.nameBgColor.length) writer.writeString(5, this.nameBgColor); - if (!w) return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): RunLine { - const reader = - bytes instanceof pb_1.BinaryReader - ? bytes - : new pb_1.BinaryReader(bytes), - message = new RunLine(); - while (reader.nextField()) { - if (reader.isEndGroup()) break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage( - message.common, - () => (message.common = CommonInfo.deserialize(reader)) - ); - break; - case 2: - message.code = reader.readString(); - break; - case 3: - reader.readMessage(message.points, () => - pb_1.Message.addToRepeatedWrapperField( - message, - 3, - Point.deserialize(reader), - Point - ) - ); - break; - case 4: - message.nameColor = reader.readString(); - break; - case 5: - message.nameBgColor = reader.readString(); - break; - default: - reader.skipField(); + set code(value: string) { + pb_1.Message.setField(this, 2, value); + } + get points() { + return pb_1.Message.getRepeatedWrapperField(this, Point, 3) as Point[]; + } + set points(value: Point[]) { + pb_1.Message.setRepeatedWrapperField(this, 3, value); + } + get nameColor() { + return pb_1.Message.getFieldWithDefault(this, 4, "") as string; + } + set nameColor(value: string) { + pb_1.Message.setField(this, 4, value); + } + get nameBgColor() { + return pb_1.Message.getFieldWithDefault(this, 5, "") as string; + } + set nameBgColor(value: string) { + pb_1.Message.setField(this, 5, value); + } + static fromObject(data: { + common?: ReturnType; + code?: string; + points?: ReturnType[]; + nameColor?: string; + nameBgColor?: string; + }): RunLine { + const message = new RunLine({}); + if (data.common != null) { + message.common = CommonInfo.fromObject(data.common); + } + if (data.code != null) { + message.code = data.code; + } + if (data.points != null) { + message.points = data.points.map(item => Point.fromObject(item)); + } + if (data.nameColor != null) { + message.nameColor = data.nameColor; + } + if (data.nameBgColor != null) { + message.nameBgColor = data.nameBgColor; + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + points?: ReturnType[]; + nameColor?: string; + nameBgColor?: string; + } = {}; + if (this.common != null) { + data.common = this.common.toObject(); + } + if (this.code != null) { + data.code = this.code; + } + if (this.points != null) { + data.points = this.points.map((item: Point) => item.toObject()); + } + if (this.nameColor != null) { + data.nameColor = this.nameColor; + } + if (this.nameBgColor != null) { + data.nameBgColor = this.nameBgColor; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.has_common) + writer.writeMessage(1, this.common, () => this.common.serialize(writer)); + if (this.code.length) + writer.writeString(2, this.code); + if (this.points.length) + writer.writeRepeatedMessage(3, this.points, (item: Point) => item.serialize(writer)); + if (this.nameColor.length) + writer.writeString(4, this.nameColor); + if (this.nameBgColor.length) + writer.writeString(5, this.nameBgColor); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): RunLine { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new RunLine(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.common, () => message.common = CommonInfo.deserialize(reader)); + break; + case 2: + message.code = reader.readString(); + break; + case 3: + reader.readMessage(message.points, () => pb_1.Message.addToRepeatedWrapperField(message, 3, Point.deserialize(reader), Point)); + break; + case 4: + message.nameColor = reader.readString(); + break; + case 5: + message.nameBgColor = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): RunLine { + return RunLine.deserialize(bytes); } - } - return message; } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): RunLine { - return RunLine.deserialize(bytes); - } - } - export class Section extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor( - data?: - | any[] - | { + export class Section extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { common?: CommonInfo; code?: string; points?: Point[]; - } - ) { - super(); - pb_1.Message.initialize( - this, - Array.isArray(data) ? data : [], - 0, - -1, - [3], - this.#one_of_decls - ); - if (!Array.isArray(data) && typeof data == 'object') { - if ('common' in data && data.common != undefined) { - this.common = data.common; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("common" in data && data.common != undefined) { + this.common = data.common; + } + if ("code" in data && data.code != undefined) { + this.code = data.code; + } + if ("points" in data && data.points != undefined) { + this.points = data.points; + } + } } - if ('code' in data && data.code != undefined) { - this.code = data.code; + get common() { + return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; } - if ('points' in data && data.points != undefined) { - this.points = data.points; + set common(value: CommonInfo) { + pb_1.Message.setWrapperField(this, 1, value); } - } - } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; - } - set common(value: CommonInfo) { - pb_1.Message.setWrapperField(this, 1, value); - } - get has_common() { - return pb_1.Message.getField(this, 1) != null; - } - get code() { - return pb_1.Message.getFieldWithDefault(this, 2, '') as string; - } - set code(value: string) { - pb_1.Message.setField(this, 2, value); - } - get points() { - return pb_1.Message.getRepeatedWrapperField(this, Point, 3) as Point[]; - } - set points(value: Point[]) { - pb_1.Message.setRepeatedWrapperField(this, 3, value); - } - static fromObject(data: { - common?: ReturnType; - code?: string; - points?: ReturnType[]; - }): Section { - const message = new Section({}); - if (data.common != null) { - message.common = CommonInfo.fromObject(data.common); - } - if (data.code != null) { - message.code = data.code; - } - if (data.points != null) { - message.points = data.points.map((item) => Point.fromObject(item)); - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - points?: ReturnType[]; - } = {}; - if (this.common != null) { - data.common = this.common.toObject(); - } - if (this.code != null) { - data.code = this.code; - } - if (this.points != null) { - data.points = this.points.map((item: Point) => item.toObject()); - } - return data; - } - serialize(): Uint8Array; - serialize(w: pb_1.BinaryWriter): void; - serialize(w?: pb_1.BinaryWriter): Uint8Array | void { - const writer = w || new pb_1.BinaryWriter(); - if (this.has_common) - writer.writeMessage(1, this.common, () => - this.common.serialize(writer) - ); - if (this.code.length) writer.writeString(2, this.code); - if (this.points.length) - writer.writeRepeatedMessage(3, this.points, (item: Point) => - item.serialize(writer) - ); - if (!w) return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Section { - const reader = - bytes instanceof pb_1.BinaryReader - ? bytes - : new pb_1.BinaryReader(bytes), - message = new Section(); - while (reader.nextField()) { - if (reader.isEndGroup()) break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage( - message.common, - () => (message.common = CommonInfo.deserialize(reader)) - ); - break; - case 2: - message.code = reader.readString(); - break; - case 3: - reader.readMessage(message.points, () => - pb_1.Message.addToRepeatedWrapperField( - message, - 3, - Point.deserialize(reader), - Point - ) - ); - break; - default: - reader.skipField(); + get has_common() { + return pb_1.Message.getField(this, 1) != null; + } + get code() { + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; + } + set code(value: string) { + pb_1.Message.setField(this, 2, value); + } + get points() { + return pb_1.Message.getRepeatedWrapperField(this, Point, 3) as Point[]; + } + set points(value: Point[]) { + pb_1.Message.setRepeatedWrapperField(this, 3, value); + } + static fromObject(data: { + common?: ReturnType; + code?: string; + points?: ReturnType[]; + }): Section { + const message = new Section({}); + if (data.common != null) { + message.common = CommonInfo.fromObject(data.common); + } + if (data.code != null) { + message.code = data.code; + } + if (data.points != null) { + message.points = data.points.map(item => Point.fromObject(item)); + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + points?: ReturnType[]; + } = {}; + if (this.common != null) { + data.common = this.common.toObject(); + } + if (this.code != null) { + data.code = this.code; + } + if (this.points != null) { + data.points = this.points.map((item: Point) => item.toObject()); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.has_common) + writer.writeMessage(1, this.common, () => this.common.serialize(writer)); + if (this.code.length) + writer.writeString(2, this.code); + if (this.points.length) + writer.writeRepeatedMessage(3, this.points, (item: Point) => item.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Section { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Section(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.common, () => message.common = CommonInfo.deserialize(reader)); + break; + case 2: + message.code = reader.readString(); + break; + case 3: + reader.readMessage(message.points, () => pb_1.Message.addToRepeatedWrapperField(message, 3, Point.deserialize(reader), Point)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Section { + return Section.deserialize(bytes); } - } - return message; } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): Section { - return Section.deserialize(bytes); - } - } }