@zerospacegg/iolin
Version:
Pure TypeScript implementation of ZeroSpace game data processing (PKL-free)
91 lines • 3.71 kB
JavaScript
/**
* ZeroSpace Game Mechanics - Complete System
*
* This module exports all game mechanics for ZeroSpace, including both basic
* fundamental mechanics and advanced transformation systems. Mechanics represent
* core gameplay rules and systems that define how the game operates.
*
* Categories:
* - Basic Mechanics: Fundamental gameplay concepts and rules
* - Transformation Mechanics: Complex multi-phase systems that modify units
*/
// Import all mechanic collections
import { allBasicMechanics, combatMechanics, economicMechanics, factionMechanics, supportMechanics, systemMechanics, } from "./basic.js";
import { allTransformationMechanics, controlTransformations, enhancementTransformations, necromancyTransformations, } from "./transformations.js";
// Export individual collections
export { allBasicMechanics, allTransformationMechanics, combatMechanics, controlTransformations, economicMechanics, enhancementTransformations, factionMechanics, necromancyTransformations, supportMechanics, systemMechanics, };
// Export all mechanics combined
export const allMechanics = [...allBasicMechanics, ...allTransformationMechanics];
// Export mechanics by type
export const basicMechanics = allBasicMechanics;
export const transformationMechanics = allTransformationMechanics;
// Export mechanics by gameplay area
export const combatAndTransformationMechanics = [
...combatMechanics,
...enhancementTransformations,
...necromancyTransformations,
];
export const utilityAndSystemMechanics = [...supportMechanics, ...systemMechanics, ...controlTransformations];
export const economicAndFactionMechanics = [...economicMechanics, ...factionMechanics];
// Export mechanics statistics
export const mechanicsStats = {
totalMechanics: allMechanics.length,
basicMechanics: allBasicMechanics.length,
transformationMechanics: allTransformationMechanics.length,
categories: {
combat: combatMechanics.length,
economic: economicMechanics.length,
support: supportMechanics.length,
faction: factionMechanics.length,
system: systemMechanics.length,
enhancement: enhancementTransformations.length,
necromancy: necromancyTransformations.length,
control: controlTransformations.length,
},
};
// Export search functionality
export function searchMechanics(query) {
const results = allMechanics.filter(mechanic => mechanic.matches(query));
return {
query,
totalResults: results.length,
results: results.map(mechanic => ({
name: mechanic.name,
summary: mechanic.summary,
keywords: mechanic.keywords,
})),
mechanics: results,
};
}
// Export mechanic lookup by name
export function getMechanicByName(name) {
return allMechanics.find(mechanic => mechanic.name.toLowerCase() === name.toLowerCase());
}
// Export mechanics by keyword
export function getMechanicsByKeyword(keyword) {
return allMechanics.filter(mechanic => mechanic.keywords.some(k => k.toLowerCase().includes(keyword.toLowerCase())));
}
// Default export containing all named exports for consistent API
export default {
allBasicMechanics,
allTransformationMechanics,
combatMechanics,
controlTransformations,
economicMechanics,
enhancementTransformations,
factionMechanics,
necromancyTransformations,
supportMechanics,
systemMechanics,
allMechanics,
basicMechanics,
transformationMechanics,
combatAndTransformationMechanics,
utilityAndSystemMechanics,
economicAndFactionMechanics,
mechanicsStats,
searchMechanics,
getMechanicByName,
getMechanicsByKeyword,
};
//# sourceMappingURL=index.js.map