import ENABLED_ABILITIES from "./enabled_abilities" ; import data from "./data.json" ; const ENABLED_UNITS = new Set ( ) ; data . Ability . forEach ( ( ability ) => { const target = ability . target ; if ( typeof target !== "string" ) { const train = target . Train ; if ( train && ENABLED_ABILITIES . has ( ability . id ) ) { ENABLED_UNITS . add ( train . produces ) ; return ; } const morph = target . Morph ; if ( morph !== undefined && ENABLED_ABILITIES . has ( ability . id ) ) { ENABLED_UNITS . add ( morph . produces ) ; return ; } const build = target . BuildInstant ; if ( build !== undefined && ENABLED_ABILITIES . has ( ability . id ) ) { ENABLED_UNITS . add ( build . produces ) ; return ; } const trainPlace = target . TrainPlace ; if ( trainPlace !== undefined && ENABLED_ABILITIES . has ( ability . id ) ) { ENABLED_UNITS . add ( trainPlace . produces ) ; return ; } const buildStructure = target . Build ; if ( buildStructure !== undefined && ENABLED_ABILITIES . has ( ability . id ) ) { ENABLED_UNITS . add ( buildStructure . produces ) ; return ; } const buildGas = target . BuildOnUnit ; if ( buildGas !== undefined && ENABLED_ABILITIES . has ( ability . id ) ) { ENABLED_UNITS . add ( buildGas . produces ) ; return ; } } } ) ; export default ENABLED_UNITS ;