node-insim
Version:
An InSim library for NodeJS with TypeScript support
64 lines (63 loc) • 1.66 kB
JavaScript
import { __decorate } from "tslib";
import { byte, struct, unsigned } from '../decorators';
import { Packet } from './base';
import { PacketType } from './enums';
import { CarContOBJ } from './structs';
/**
* Car State Changed - reports a change in a car's state (currently start or stop)
*/
export class IS_CSC extends Packet {
constructor() {
super(...arguments);
this.Size = 20;
this.Type = PacketType.ISP_CSC;
this.ReqI = 0;
/** Player's unique id */
this.PLID = 0;
this.Sp0 = 0;
this.CSCAction = 0;
this.Sp2 = 0;
this.Sp3 = 0;
/** Milliseconds since start (as in {@link SMALL_RTP}) */
this.Time = 0;
/** Car contact object */
this.C = new CarContOBJ();
}
}
__decorate([
byte()
], IS_CSC.prototype, "Size", void 0);
__decorate([
byte()
], IS_CSC.prototype, "Type", void 0);
__decorate([
byte()
], IS_CSC.prototype, "ReqI", void 0);
__decorate([
byte()
], IS_CSC.prototype, "PLID", void 0);
__decorate([
byte()
], IS_CSC.prototype, "Sp0", void 0);
__decorate([
byte()
], IS_CSC.prototype, "CSCAction", void 0);
__decorate([
byte()
], IS_CSC.prototype, "Sp2", void 0);
__decorate([
byte()
], IS_CSC.prototype, "Sp3", void 0);
__decorate([
unsigned()
], IS_CSC.prototype, "Time", void 0);
__decorate([
struct(CarContOBJ)
], IS_CSC.prototype, "C", void 0);
export var CSCAction;
(function (CSCAction) {
/** Car stopped */
CSCAction[CSCAction["CSC_STOP"] = 0] = "CSC_STOP";
/** Car started */
CSCAction[CSCAction["CSC_START"] = 1] = "CSC_START";
})(CSCAction || (CSCAction = {}));