UNPKG

sc4

Version:

A command line utility for automating SimCity 4 modding tasks & modifying savegames

29 lines (28 loc) 760 B
import type { TGILiteral } from 'sc4/types'; type u32 = number; type IndexKey = bigint; type IndexValue = number[]; type IndexTuple = [IndexKey, IndexValue]; type IndexMap = Map<IndexKey, IndexValue>; type IndexCache = { tgi: IndexTuple[]; ti: IndexTuple[]; t: IndexTuple[]; }; export type TGIIndexJSON = { tgi: [IndexKey, IndexValue][]; ti: [IndexKey, IndexValue][]; t: [IndexKey, IndexValue][]; }; export default class MappedIndex<T extends TGILiteral> { tgi: IndexMap; ti: IndexMap; t: IndexMap; constructor(entries?: T[]); load(cache: IndexCache): this; findTGI(t: u32, g: u32, i: u32): number[]; findType(t: u32): number[]; findTI(t: u32, i: u32): number[]; toJSON(): TGIIndexJSON; } export {};