diff --git a/dist/screeps-tests.ts b/dist/screeps-tests.ts index 6d28386..27af63d 100644 --- a/dist/screeps-tests.ts +++ b/dist/screeps-tests.ts @@ -1030,8 +1030,24 @@ function resources(o: GenericStore): ResourceConstant[] { EXTENSION_ENERGY_CAPACITY[Game.rooms.myRoom.controller!.level]; REACTIONS[Object.keys(creep.carry)[0]]; +} + +{ + // Test the BOOSTS constant + + // Can be used with a body part, returns a record of mineral -> boosted property -> level + const c = BOOSTS[creep.body[0].type]; - BOOSTS[creep.body[0].type]; + // Can be used with all body part types, returns undefined + const undef = BOOSTS["claim"]; + + // Can still be iterated over + for (const bodyPart of Object.keys(BOOSTS) as BodyPartConstant[]) { + const boosts = BOOSTS[bodyPart]; + for (const mineral of Object.keys(boosts) as MineralBoostConstant[]) { + const upgrades = boosts[mineral]; + } + } } // Tombstones