import java.util.ArrayList;
import java.util.List;

// Configuration class for Enemy Collective Hitbox Expansion (Maximized Values)
public class EnemyHitboxExpansionConfig {
    // Core configuration title
    private final String configTitle = "Enemy Collective Hitbox Expansion MAX";
    
    // 1. Hitbox expansion when enemies are in player's field of view (maximized)
    private static class InViewHitboxExpansion {
        private final double expansionProbability = 1.0; // Maximized to 100% (represented as 1.0)
        private final double hitboxExpansionValue = 99.99; // Maximized from 99 to 99.99
        private final String description = "Enemies appearing within the player's field of view - collective hitbox expansion";

        public double getExpansionProbability() { return expansionProbability; }
        public double getHitboxExpansionValue() { return hitboxExpansionValue; }
        public String getDescription() { return description; }
    }
    private final InViewHitboxExpansion inViewHitboxExpansion = new InViewHitboxExpansion();
    
    // 2. Enemy hitbox area, volume & diffusion (maximized)
    private static class HitboxAreaVolume {
        private final double baseValue = 0.1; // Retained as base; maximized diffusion
        private final double diffusionValue = 99.99; // Maximized from 99 to 99.99
        private final String description = "Enemy hitbox area - volume - expansion and diffusion of enemy hitbox range";

        public double getBaseValue() { return baseValue; }
        public double getDiffusionValue() { return diffusionValue; }
        public String getDescription() { return description; }
    }
    private final HitboxAreaVolume hitboxAreaVolume = new HitboxAreaVolume();
    
    // 3. Effective hitbox range for each enemy body part (maximized)
    private static class BodyPartHitbox {
        private final String bodyPart;
        private final double effectiveRange; // Maximized to 99.99
        private final String description;

        public BodyPartHitbox(String bodyPart, double effectiveRange, String description) {
            this.bodyPart = bodyPart;
            this.effectiveRange = effectiveRange;
            this.description = description;
        }

        public String getBodyPart() { return bodyPart; }
        public double getEffectiveRange() { return effectiveRange; }
        public String getDescription() { return description; }
    }
    private final List<BodyPartHitbox> bodyPartHitboxList;
    
    // 4. Bullet vertical spread & synchronous hitbox expansion (maximized)
    private static class BulletVerticalSpread {
        private final double syncExpansionValue = 99.99; // Maximized from 99 to 99.99
        private final double expansionProbability = 1.0; // Maximized to 100% (1.0)
        private final String description = "Vertical spread of weapon bullets hitting enemy hitbox - enemy hitbox synchronous expansion";

        public double getSyncExpansionValue() { return syncExpansionValue; }
        public double getExpansionProbability() { return expansionProbability; }
        public String getDescription() { return description; }
    }
    private final BulletVerticalSpread bulletVerticalSpread = new BulletVerticalSpread();
    
    // 5. Cover penetration & focus probability (maximized to 100%)
    private static class CoverPenetration {
        private final String targetBodyPart;
        private final double focusProbability = 1.0; // Maximized from 45% to 100% (1.0)
        private final String damageNote = "Bullets collide with the enemy and cause substantial damage";
        private final String description;

        public CoverPenetration(String targetBodyPart, String description) {
            this.targetBodyPart = targetBodyPart;
            this.description = description;
        }

        public String getTargetBodyPart() { return targetBodyPart; }
        public double getFocusProbability() { return focusProbability; }
        public String getDamageNote() { return damageNote; }
        public String getDescription() { return description; }
    }
    private final List<CoverPenetration> coverPenetrationList;
    
    // Initialize all maximized configurations
    public EnemyHitboxExpansionConfig() {
        // Initialize body part hitbox list (max effective range: 99.99)
        bodyPartHitboxList = new ArrayList<>();
        bodyPartHitboxList.add(new BodyPartHitbox(
            "enemy head", 
            99.99, 
            "Effective hitbox range for weapon bullets colliding with"
        ));
        bodyPartHitboxList.add(new BodyPartHitbox(
            "enemy torso", 
            99.99, 
            "Effective hitbox range for weapon bullets colliding with"
        ));
        bodyPartHitboxList.add(new BodyPartHitbox(
            "enemy limbs", 
            99.99, 
            "Effective hitbox range for weapon bullets colliding with"
        ));
        
        // Initialize cover penetration list (max focus probability: 100%)
        coverPenetrationList = new ArrayList<>();
        coverPenetrationList.add(new CoverPenetration(
            "enemy head", 
            "Probability of ignoring cover and focusing on with bullet penetration when enemies are in front of/behind cover"
        ));
        coverPenetrationList.add(new CoverPenetration(
            "enemy torso", 
            "Probability of ignoring cover and focusing on with bullet penetration when enemies are in front of/behind cover"
        ));
        coverPenetrationList.add(new CoverPenetration(
            "enemy limbs", 
            "Probability of ignoring cover and focusing on with bullet penetration when enemies are in front of/behind cover"
        ));
    }
    
    // Getters for external access (read-only, ensured by final fields)
    public String getConfigTitle() { return configTitle; }
    public InViewHitboxExpansion getInViewHitboxExpansion() { return inViewHitboxExpansion; }
    public HitboxAreaVolume getHitboxAreaVolume() { return hitboxAreaVolume; }
    public List<BodyPartHitbox> getBodyPartHitboxList() { return bodyPartHitboxList; }
    public BulletVerticalSpread getBulletVerticalSpread() { return bulletVerticalSpread; }
    public List<CoverPenetration> getCoverPenetrationList() { return coverPenetrationList; }
    
    // Test method: print all maximized configurations
    public static void main(String[] args) {
        EnemyHitboxExpansionConfig maxConfig = new EnemyHitboxExpansionConfig();
        
        // Print core title
        System.out.println("=== " + maxConfig.getConfigTitle() + " ===");
        
        // Print in-view expansion
        System.out.printf("\n1. %s\n- Probability: %.0f%%\n- Expansion Value: %.2f\n",
            maxConfig.getInViewHitboxExpansion().getDescription(),
            maxConfig.getInViewHitboxExpansion().getExpansionProbability() * 100,
            maxConfig.getInViewHitboxExpansion().getHitboxExpansionValue()
        );
        
        // Print head hitbox range (example of body part)
        BodyPartHitbox headHitbox = maxConfig.getBodyPartHitboxList().get(0);
        System.out.printf("\n2. %s %s\n- Effective Range: %.2f\n",
            headHitbox.getDescription(),
            headHitbox.getBodyPart(),
            headHitbox.getEffectiveRange()
        );
        
        // Print cover penetration (example)
        CoverPenetration torsoPenetration = maxConfig.getCoverPenetrationList().get(1);
        System.out.printf("\n3. %s %s\n- Focus Probability: %.0f%%\n- Note: %s\n",
            torsoPenetration.getDescription(),
            torsoPenetration.getTargetBodyPart(),
            torsoPenetration.getFocusProbability() * 100,
            torsoPenetration.getDamageNote()
        );
    }
}
