slp-enforcer
Version:
Finds violations of the Melee Controller Ruleset by inspecting SLP files
66 lines (65 loc) • 2.33 kB
TypeScript
/// <reference types="node" />
import { SlippiGame } from './slippi';
export { hasDisallowedCStickCoords, getCStickViolations } from './disallowed_analog_values';
export { averageTravelCoordHitRate, hasIllegalTravelTime } from './travel_time';
export { hasIllegalUptiltRounding } from './uptilt_rounding';
export { hasIllegalSDI } from './sdi';
export { isGoomwave } from './goomwave';
export { hasIllegalCrouchUptilt } from './crouch_uptilt';
export { controlStickViz } from './control_stick_viz';
export * from './slippi';
export declare class CheckResult {
result: boolean;
violations: Violation[];
constructor(result: boolean, violations?: Violation[]);
}
export declare class Violation {
metric: number;
reason: string;
evidence: any[];
constructor(metric: number, reason: string, evidence?: any[]);
}
export declare type Check = {
name: string;
checkFunction: (game: SlippiGame, playerIndex: number, coords: Coord[]) => CheckResult;
};
export declare function ListChecks(): Check[];
export declare type GamePad = {
mainStick: Coord;
cStick: Coord;
trigger: number;
a: boolean;
b: boolean;
x: boolean;
y: boolean;
z: boolean;
l: boolean;
r: boolean;
};
export declare type Coord = {
x: number;
y: number;
};
export declare function jsonToCoord(json: string): Coord;
export declare function isEqual(one: Coord, other: Coord): boolean;
export declare function FloatEquals(a: number, b: number): boolean;
export declare function toArrayBuffer(buffer: Buffer): ArrayBuffer;
export declare enum JoystickRegion {
DZ = 0,
NE = 1,
SE = 2,
SW = 3,
NW = 4,
N = 5,
E = 6,
S = 7,
W = 8
}
export declare function getJoystickRegion(x: number, y: number): JoystickRegion;
export declare function getUniqueCoords(coordinates: Coord[]): Coord[];
export declare function getTargetCoords(coordinates: Coord[]): Coord[];
export declare function processAnalogStick(coord: Coord, deadzone: boolean): Coord;
export declare function getCoordListFromGame(game: SlippiGame, playerIndex: number, isMainStick: boolean): Coord[];
export declare function isBoxController(coordinates: Coord[]): boolean;
export declare function isSlpMinVersion(game: SlippiGame): boolean;
export declare function isHandwarmer(game: SlippiGame): boolean;