node-insim
Version:
An InSim library for NodeJS with TypeScript support
94 lines (93 loc) • 2.55 kB
JavaScript
import { __decorate } from "tslib";
import { byte, float, struct, unsigned } from '../decorators';
import { OutSimMain } from '../out/OutSimMain';
import { Packet } from './base';
import { PacketType } from './enums';
import { AICGear } from './IS_AIC';
/**
* AI car info
*
* Send a {@link SMALL_AII} with UVal set to PLID to receive current information about a local car.
*/
export class IS_AII extends Packet {
constructor() {
super(...arguments);
this.Size = 96;
this.Type = PacketType.ISP_AII;
/** ReqI from the {@link SMALL_AII} request packet */
this.ReqI = 0;
this.PLID = 0;
/** Identical to {@link OutSimMain} */
this.OSData = new OutSimMain();
this.Flags = 0;
/** Reverse: 0, Neutral: 1, First: 2... */
this.Gear = AICGear.REVERSE;
this.Sp2 = 0;
this.Sp3 = 0;
this.RPM = 0;
this.SpF0 = 0;
this.SpF1 = 0;
/** Dash lights currently switched on (see DL_x in OutGauge section below) */
this.ShowLights = 0;
this.SPU1 = 0;
this.SPU2 = 0;
this.SPU3 = 0;
}
}
__decorate([
byte()
], IS_AII.prototype, "Size", void 0);
__decorate([
byte()
], IS_AII.prototype, "Type", void 0);
__decorate([
byte()
], IS_AII.prototype, "ReqI", void 0);
__decorate([
byte()
], IS_AII.prototype, "PLID", void 0);
__decorate([
struct(OutSimMain)
], IS_AII.prototype, "OSData", void 0);
__decorate([
byte()
], IS_AII.prototype, "Flags", void 0);
__decorate([
byte()
], IS_AII.prototype, "Gear", void 0);
__decorate([
byte()
], IS_AII.prototype, "Sp2", void 0);
__decorate([
byte()
], IS_AII.prototype, "Sp3", void 0);
__decorate([
float()
], IS_AII.prototype, "RPM", void 0);
__decorate([
float()
], IS_AII.prototype, "SpF0", void 0);
__decorate([
float()
], IS_AII.prototype, "SpF1", void 0);
__decorate([
unsigned()
], IS_AII.prototype, "ShowLights", void 0);
__decorate([
unsigned()
], IS_AII.prototype, "SPU1", void 0);
__decorate([
unsigned()
], IS_AII.prototype, "SPU2", void 0);
__decorate([
unsigned()
], IS_AII.prototype, "SPU3", void 0);
export var AIFlags;
(function (AIFlags) {
/** Detect if engine running */
AIFlags[AIFlags["AIFLAGS_IGNITION"] = 1] = "AIFLAGS_IGNITION";
/** Upshift lever currently held */
AIFlags[AIFlags["AIFLAGS_CHUP"] = 4] = "AIFLAGS_CHUP";
/** Downshift lever currently held */
AIFlags[AIFlags["AIFLAGS_CHDN"] = 8] = "AIFLAGS_CHDN";
})(AIFlags || (AIFlags = {}));