UNPKG

node-insim

Version:

An InSim library for NodeJS with TypeScript support

54 lines (53 loc) 1.53 kB
import { __decorate } from "tslib"; import { byte, struct, word } from '../decorators'; import { Packet } from './base'; import { PacketType } from './enums'; import { CarContact } from './structs'; /** * CONtact - between two cars (A and B are sorted by PLID) * * This packet reports contacts between two cars if the closing speed is above 0.25 m/s. * * Set the {@link ISF_CON} flag in the {@link IS_ISI} to receive car contact reports. */ export class IS_CON extends Packet { constructor() { super(...arguments); this.Size = 40; this.Type = PacketType.ISP_CON; this.ReqI = 0; this.Zero = 0; /** High 4 bits: reserved / low 12 bits: closing speed (10 = 1 m/s) */ this.SpClose = 0; /** Looping time stamp (hundredths - time since reset - like {@link TINY_GTH}) */ this.Time = 0; /** Contact object - car A */ this.A = new CarContact(); /** Contact object - car B */ this.B = new CarContact(); } } __decorate([ byte() ], IS_CON.prototype, "Size", void 0); __decorate([ byte() ], IS_CON.prototype, "Type", void 0); __decorate([ byte() ], IS_CON.prototype, "ReqI", void 0); __decorate([ byte() ], IS_CON.prototype, "Zero", void 0); __decorate([ word() ], IS_CON.prototype, "SpClose", void 0); __decorate([ word() ], IS_CON.prototype, "Time", void 0); __decorate([ struct(CarContact) ], IS_CON.prototype, "A", void 0); __decorate([ struct(CarContact) ], IS_CON.prototype, "B", void 0);