UNPKG

node-insim

Version:

An InSim library for NodeJS with TypeScript support

91 lines (90 loc) 2.64 kB
import { __decorate } from "tslib"; import { byte, short, struct, unsigned, word } from '../decorators'; import { Packet } from './base'; import { PacketType } from './enums'; import { CarContOBJ } from './structs'; /** * OBject Hit - car hit an autocross object or an unknown object * * Set the {@link ISF_OBH} flag in the {@link IS_ISI} to receive object contact reports. */ export class IS_OBH extends Packet { constructor() { super(...arguments); this.Size = 28; this.Type = PacketType.ISP_OBH; this.ReqI = 0; /** Player's unique id */ this.PLID = 0; /** High 4 bits: reserved / low 12 bits: closing speed (10 = 1 m/s) */ this.SpClose = 0; this.SpW = 0; /** Time stamp (ms) */ this.Time = 0; /** Contact object */ this.C = new CarContOBJ(); /** Position (1 metre = 16) */ this.X = 0; /** Position (1 metre = 16) */ this.Y = 0; /** If {@link OBH_LAYOUT} is set: Zbyte as in {@link ObjectInfo} */ this.Zbyte = 0; this.Sp1 = 0; /** AXO_x as in {@link ObjectInfo} or zero if it is an unknown object */ this.Index = 0; this.OBHFlags = 0; } } __decorate([ byte() ], IS_OBH.prototype, "Size", void 0); __decorate([ byte() ], IS_OBH.prototype, "Type", void 0); __decorate([ byte() ], IS_OBH.prototype, "ReqI", void 0); __decorate([ byte() ], IS_OBH.prototype, "PLID", void 0); __decorate([ word() ], IS_OBH.prototype, "SpClose", void 0); __decorate([ word() ], IS_OBH.prototype, "SpW", void 0); __decorate([ unsigned() ], IS_OBH.prototype, "Time", void 0); __decorate([ struct(CarContOBJ) ], IS_OBH.prototype, "C", void 0); __decorate([ short() ], IS_OBH.prototype, "X", void 0); __decorate([ short() ], IS_OBH.prototype, "Y", void 0); __decorate([ byte() ], IS_OBH.prototype, "Zbyte", void 0); __decorate([ byte() ], IS_OBH.prototype, "Sp1", void 0); __decorate([ byte() ], IS_OBH.prototype, "Index", void 0); __decorate([ byte() ], IS_OBH.prototype, "OBHFlags", void 0); export var ObjectHitFlags; (function (ObjectHitFlags) { /** An added object */ ObjectHitFlags[ObjectHitFlags["OBH_LAYOUT"] = 1] = "OBH_LAYOUT"; /** A movable object */ ObjectHitFlags[ObjectHitFlags["OBH_CAN_MOVE"] = 2] = "OBH_CAN_MOVE"; /** Was moving before this hit */ ObjectHitFlags[ObjectHitFlags["OBH_WAS_MOVING"] = 4] = "OBH_WAS_MOVING"; /** Object in original position */ ObjectHitFlags[ObjectHitFlags["OBH_ON_SPOT"] = 8] = "OBH_ON_SPOT"; })(ObjectHitFlags || (ObjectHitFlags = {}));