UNPKG

node-insim

Version:

An InSim library for NodeJS with TypeScript support

127 lines (126 loc) 4.15 kB
import { __decorate } from "tslib"; import { byte, unsigned, word } from '../decorators'; import { Packet } from './base'; import { PacketType, PenaltyValue, TyreCompound } from './enums'; /** * PIT stop (stop at pit garage) */ export class IS_PIT extends Packet { constructor() { super(...arguments); this.Size = 24; this.Type = PacketType.ISP_PIT; this.ReqI = 0; /** Player's unique id */ this.PLID = 0; /** Laps completed */ this.LapsDone = 0; /** Player flags */ this.Flags = 0; /** /showfuel yes: fuel added percent / no: 255 */ this.FuelAdd = 0; /** Current penalty value */ this.Penalty = PenaltyValue.PENALTY_NONE; /** Number of pit stops */ this.NumStops = 0; this.Sp3 = 0; /** Rear left tyre compound */ this.TyreRL = TyreCompound.TYRE_R1; /** Rear right tyre compound */ this.TyreRR = TyreCompound.TYRE_R1; /** Front left tyre compound */ this.TyreFL = TyreCompound.TYRE_R1; /** Front right tyre compound */ this.TyreFR = TyreCompound.TYRE_R1; /** Pit work */ this.Work = 0; this.Spare = 0; } } __decorate([ byte() ], IS_PIT.prototype, "Size", void 0); __decorate([ byte() ], IS_PIT.prototype, "Type", void 0); __decorate([ byte() ], IS_PIT.prototype, "ReqI", void 0); __decorate([ byte() ], IS_PIT.prototype, "PLID", void 0); __decorate([ word() ], IS_PIT.prototype, "LapsDone", void 0); __decorate([ word() ], IS_PIT.prototype, "Flags", void 0); __decorate([ byte() ], IS_PIT.prototype, "FuelAdd", void 0); __decorate([ byte() ], IS_PIT.prototype, "Penalty", void 0); __decorate([ byte() ], IS_PIT.prototype, "NumStops", void 0); __decorate([ byte() ], IS_PIT.prototype, "Sp3", void 0); __decorate([ byte() ], IS_PIT.prototype, "TyreRL", void 0); __decorate([ byte() ], IS_PIT.prototype, "TyreRR", void 0); __decorate([ byte() ], IS_PIT.prototype, "TyreFL", void 0); __decorate([ byte() ], IS_PIT.prototype, "TyreFR", void 0); __decorate([ unsigned() ], IS_PIT.prototype, "Work", void 0); __decorate([ unsigned() ], IS_PIT.prototype, "Spare", void 0); export var PitWorkFlags; (function (PitWorkFlags) { /** No work done */ PitWorkFlags[PitWorkFlags["PSE_NOTHING"] = 1] = "PSE_NOTHING"; /** Stopped at pit box */ PitWorkFlags[PitWorkFlags["PSE_STOP"] = 2] = "PSE_STOP"; /** Front damage */ PitWorkFlags[PitWorkFlags["PSE_FR_DAM"] = 4] = "PSE_FR_DAM"; /** Front wheels change */ PitWorkFlags[PitWorkFlags["PSE_FR_WHL"] = 8] = "PSE_FR_WHL"; /** Left front damage */ PitWorkFlags[PitWorkFlags["PSE_LE_FR_DAM"] = 16] = "PSE_LE_FR_DAM"; /** Left front wheel change */ PitWorkFlags[PitWorkFlags["PSE_LE_FR_WHL"] = 32] = "PSE_LE_FR_WHL"; /** Right front damage */ PitWorkFlags[PitWorkFlags["PSE_RI_FR_DAM"] = 64] = "PSE_RI_FR_DAM"; /** Right front wheel change */ PitWorkFlags[PitWorkFlags["PSE_RI_FR_WHL"] = 128] = "PSE_RI_FR_WHL"; /** Rear damage */ PitWorkFlags[PitWorkFlags["PSE_RE_DAM"] = 256] = "PSE_RE_DAM"; /** Rear wheels change */ PitWorkFlags[PitWorkFlags["PSE_RE_WHL"] = 512] = "PSE_RE_WHL"; /** Left rear damage */ PitWorkFlags[PitWorkFlags["PSE_LE_RE_DAM"] = 1024] = "PSE_LE_RE_DAM"; /** Left rear wheel change */ PitWorkFlags[PitWorkFlags["PSE_LE_RE_WHL"] = 2048] = "PSE_LE_RE_WHL"; /** Right rear damage */ PitWorkFlags[PitWorkFlags["PSE_RI_RE_DAM"] = 4096] = "PSE_RI_RE_DAM"; /** Right rear wheel change */ PitWorkFlags[PitWorkFlags["PSE_RI_RE_WHL"] = 8192] = "PSE_RI_RE_WHL"; /** Minor body damage */ PitWorkFlags[PitWorkFlags["PSE_BODY_MINOR"] = 16384] = "PSE_BODY_MINOR"; /** Major body damage */ PitWorkFlags[PitWorkFlags["PSE_BODY_MAJOR"] = 32768] = "PSE_BODY_MAJOR"; /** Setup adjustments */ PitWorkFlags[PitWorkFlags["PSE_SETUP"] = 65536] = "PSE_SETUP"; /** Refuel */ PitWorkFlags[PitWorkFlags["PSE_REFUEL"] = 131072] = "PSE_REFUEL"; })(PitWorkFlags || (PitWorkFlags = {}));