/// <reference path="../../Bodypart.ts" />
/// <reference path="../../Humanoid/Humanoid.ts" />
/// <reference path="../SexStick.ts" />
/// <reference path="../SexHole.ts" />
/// <reference path="../../../Measure.ts" />
class HumanoidBreasts extends Bodypart {
    public size : number = 0;
    public silicone : number = 0;
    public milk : number = 0;

    public sorenessWeight = Bodypart.WEIGHT_MEDIUM;
    public genderWeight = Bodypart.WEIGHT_HIGH;
    public slots : Array<number> = [Humanoid.SLOT_BREASTS];
    public sluttiness = Bodypart.SLUTTINESS_HIGH_SLUT;
    public sluttinessWeight = Bodypart.WEIGHT_MEDIUM;

    public constructor (options? : ThingOptions) {
        super(options);
        this.addGetAlterations((thing) => {
            return {
                Size : this.size,
                Silicone : this.silicone,
                Milk : this.milk
            }
        });

        this.addSetAlterations((thing, changes) => {
            this.size = changes.Size;
            this.silicone = changes.Silicone;
            this.milk = changes.Milk;
        });
    }

    public getSize () {
        return this.size + this.silicone + this.milk;
    }

    public getSizeText () {
        return HumanoidBreasts.getSizeText(this.getSize());
    }

    public static getSizeText (size : number) {
        let names = ["flat", "AA-cup", "A-cup", "B-cup", "C-cup", "D-cup", "E-cup", "F-cup", "G-cup", "H-cup"];
        if (size >= names.length) {
            return "HUGE";
        } else {
            return names[size];
        }
    }

    public getGenderValue () {
        return HumanoidBreasts.getGenderFromSize(this.getSize());
    }

    public getSluttiness () {
        return this.getGenderValue();
    }

    public static getGenderFromSize (size : number) {
        if (size <= 0) {
            return 20;
        } else if (size <= 3) {
            return 20 * size;
        } else {
            return 80;
        }
    }

    public arrangeGenderValue (gv : number) {
        if (gv <= 20) {
            this.size = 0;
            this.silicone = 0;
            this.milk = 0;
        } else if (gv < 80) {
            this.size = Math.round(gv / 20);
        } else {
            this.size = 4;
        }
    }
}