@abextm/cache2
Version:
Utilities for reading OSRS "caches"
133 lines (132 loc) • 4.42 kB
JavaScript
const NewTypeType = undefined;
export var CompressionType;
(function (CompressionType) {
CompressionType[CompressionType["NONE"] = 0] = "NONE";
CompressionType[CompressionType["BZ2"] = 1] = "BZ2";
CompressionType[CompressionType["GZIP"] = 2] = "GZIP";
})(CompressionType || (CompressionType = {}));
export class Params extends Map {
}
function makeByID() {
let byID;
return function (id) {
if (byID === undefined) {
byID = [];
for (let [k, v] of Object.entries(this)) {
if (typeof v === "number") {
byID[v] = k;
}
}
}
return byID[id];
};
}
export var WearPos;
(function (WearPos) {
WearPos.Head = 0;
WearPos.Cape = 1;
WearPos.Amulet = 2;
WearPos.Weapon = 3;
WearPos.Torso = 4;
WearPos.Shield = 5;
WearPos.Arms = 6;
WearPos.Legs = 7;
WearPos.Hair = 8;
WearPos.Hands = 9;
WearPos.Boots = 10;
WearPos.Jaw = 11;
WearPos.Ring = 12;
WearPos.Ammo = 13;
WearPos.byID = makeByID();
})(WearPos || (WearPos = {}));
export var ObjType;
(function (ObjType) {
ObjType.WallStraight = 0;
ObjType.WallDiagonalCorner = 1;
ObjType.WallCorner = 2;
ObjType.WallSquareCorner = 3;
ObjType.WallDecorStraightNoOffset = 4;
ObjType.WallDecorStraightOffset = 5;
ObjType.WallDecorDiagonalOffset = 6;
ObjType.WallDecorDiagonalNoOffset = 7;
ObjType.WallDecorDiagonalBoth = 8;
ObjType.WallDiagonal = 9;
ObjType.CentrepieceStraight = 10;
ObjType.CentrepieceDiagonal = 11;
ObjType.RoofStraight = 12;
ObjType.RoofDiagonalWithRoofEdge = 13;
ObjType.RoofDiagonal = 14;
ObjType.RoofCornerConcave = 15;
ObjType.RoofCornerConvex = 16;
ObjType.RoofFlat = 17;
ObjType.RoofEdgeStraight = 18;
ObjType.RoofEdgeDiagonalCorner = 19;
ObjType.RoofEdgeCorner = 20;
ObjType.RoofEdgeSquarecorner = 21;
ObjType.GroundDecor = 22;
ObjType.byID = makeByID();
})(ObjType || (ObjType = {}));
export var PreAnimMoveMode;
(function (PreAnimMoveMode) {
PreAnimMoveMode.DelayMove = 0;
PreAnimMoveMode.DelayAnim = 1;
PreAnimMoveMode.Merge = 2;
PreAnimMoveMode.byID = makeByID();
})(PreAnimMoveMode || (PreAnimMoveMode = {}));
export var PostAnimMoveMode;
(function (PostAnimMoveMode) {
PostAnimMoveMode.DelayMove = 0;
PostAnimMoveMode.AbortAnim = 1;
PostAnimMoveMode.Merge = 2;
PostAnimMoveMode.byID = makeByID();
})(PostAnimMoveMode || (PostAnimMoveMode = {}));
export var AnimRestartMode;
(function (AnimRestartMode) {
AnimRestartMode.Continue = 0;
AnimRestartMode.Restart = 1;
AnimRestartMode.ResetLoops = 2;
AnimRestartMode.byID = makeByID();
})(AnimRestartMode || (AnimRestartMode = {}));
export var AmbientSoundCurve;
(function (AmbientSoundCurve) {
AmbientSoundCurve.Linear = 0;
AmbientSoundCurve.EaseInSine = 1;
AmbientSoundCurve.EaseOutSine = 2;
AmbientSoundCurve.EaseInOutSine = 3;
AmbientSoundCurve.EaseInQuad = 4;
AmbientSoundCurve.EaseOutQuad = 5;
AmbientSoundCurve.EaseInOutQuad = 6;
AmbientSoundCurve.EaseInCubic = 7;
AmbientSoundCurve.EaseOutCubic = 8;
AmbientSoundCurve.EaseInOutCubic = 9;
AmbientSoundCurve.EaseInQuart = 10;
AmbientSoundCurve.EaseOutQuart = 11;
AmbientSoundCurve.EaseInOutQuart = 12;
AmbientSoundCurve.EaseInQuint = 13;
AmbientSoundCurve.EaseOutQuint = 14;
AmbientSoundCurve.EaseInOutQuint = 15;
AmbientSoundCurve.EaseInExpo = 16;
AmbientSoundCurve.EaseOutExpo = 17;
AmbientSoundCurve.EaseInOutExpo = 18;
AmbientSoundCurve.EaseInCirc = 19;
AmbientSoundCurve.EaseOutCirc = 20;
AmbientSoundCurve.EaseInOutCirc = 21;
AmbientSoundCurve.EaseInBack = 22;
AmbientSoundCurve.EaseOutBack = 23;
AmbientSoundCurve.EaseInOutBack = 24;
AmbientSoundCurve.EaseInElastic = 25;
AmbientSoundCurve.EaseOutElastic = 26;
AmbientSoundCurve.EaseInOutElastic = 27;
AmbientSoundCurve.byID = makeByID();
})(AmbientSoundCurve || (AmbientSoundCurve = {}));
export var DBColumnID;
(function (DBColumnID) {
function pack(table, column, tupleIndex = 0) {
return ((table << 12) | ((column & 0xFF) << 4) | (tupleIndex & 0xF));
}
DBColumnID.pack = pack;
function unpack(c) {
return [c >>> 12, c >>> 4 & 0xFF, c & 0xF];
}
DBColumnID.unpack = unpack;
})(DBColumnID || (DBColumnID = {}));