@zerospacegg/iolin
Version:
Pure TypeScript implementation of ZeroSpace game data processing (PKL-free)
120 lines • 3.39 kB
TypeScript
/**
* All-Random MatchMaker - ZeroSpace Random Match Generation System
* Generates randomized faction/mercenary/hero combinations for matches
*
* Creates balanced match series with smart randomization to ensure
* fair distribution of factions, mercenaries, and heroes across multiple games.
* Perfect for ladder practice or fun random matches!
*/
export interface MatchResult {
faction: string;
merc: string;
hero: string;
}
export interface Game {
host: string;
map: string;
players: Array<MatchResult>;
}
export interface GameSet {
players: string[];
gameType: GameType;
gamesCount: number;
games: Game[];
seed: number;
}
export interface AllRandomInput {
gameType: GameType;
numberOfGames: number;
players: string[];
seed?: number;
}
export interface AllRandomResult {
gameSet: GameSet;
metadata: AllRandomMetadata;
}
export interface AllRandomMetadata {
timestamp: string;
version: string;
inputSettings: AllRandomInput;
gameBalance: {
factionsCount: number;
mercenariesCount: number;
heroesCount: number;
mapsCount: Record<GameType, number>;
};
features: {
smartRandomization: boolean;
usageTracking: boolean;
hostRotation: boolean;
mapPoolFiltering: boolean;
heroCompatibility: boolean;
};
success: boolean;
}
export type GameType = 'solo' | '1v1' | '2v2' | 'ffa';
/**
* All-Random Generator Class - Handles all match generation logic
*/
export declare class AllRandomGenerator {
private static rng;
/**
* Initialize the random number generator with a seed
*/
private static initRandom;
/**
* Get game data from the entity system
*/
private static getGameData;
/**
* Create usage tracking object from entity array
*/
private static mkUsed;
/**
* Create usage tracking object from string array
*/
private static mkUsedStr;
/**
* Smart entity selection with usage balancing
*/
private static choose;
/**
* Smart hero selection based on faction compatibility
*/
private static chooseHero;
/**
* Generate randomized faction/merc/hero combinations for a single player
*/
private static generatePlayerGames;
/**
* Generate complete match series with balanced randomization
*/
static generateGames(input: AllRandomInput): Promise<GameSet>;
/**
* Generate complete match series result with metadata
*/
static generateMatches(input: AllRandomInput): Promise<AllRandomResult>;
/**
* Get calculation metadata for the system
*/
static getGeneratorMetadata(): AllRandomMetadata;
}
export declare function generateAllRandomMatches(gameType?: GameType, numberOfGames?: number, players?: string[], seed?: number): Promise<AllRandomResult>;
export declare const output: {
files: {
"api/all-random.json": {
renderer: {
indent: string;
};
value: () => Promise<{
examples: {
'1v1_bo3': AllRandomResult;
'2v2_bo5': AllRandomResult;
ffa_single: AllRandomResult;
};
metadata: AllRandomMetadata;
}>;
};
};
};
//# sourceMappingURL=all-random.d.ts.map