const enum EEyeColor{
	BROWN,
	GREY,
	GREEN,
	BLUE
}

const enum EEyeSize{
	SMALL,
	MEDIUM,
	LARGE,
	HUGE
}

const enum EHairColor{
	BLACK,
	BROWN,
	GINGER,
	BLONDE,
	SCARLET,
	DARK_BLUE,
	BLUE,
	LIGHT_BLUE,
	DARK_GREEN,
	GREEN,
	LIGHT_GREEN,
	DARK_PINK,
	PINK,
	LIGHT_PINK,
	DARK_PURPLE,
	PURPLE,
	LIGHT_PURPLE,
	LIGHT_ORANGE,
	DARK_RED,
	CHERRY_RED,
	TURQUOISE,
	CARROT_ORANGE,
	DARK_ORANGE
}

const enum EHairLength{
	EXTREMLY_SHORT,
	SHORT,
	MEDIUM_LENGTH,
	SHOULDER_LENGTH,
	LONG,
	VERY_LONG,
	EXTREMELY_LONG,
	INCREDIBLY_LONG
}

const enum ELegHairState{
	DEFAULT,
	WAXED,
	LASERED
}

const enum ELegHairVisibility{
	SMOOTH,
	INVISIBLE,
	NOTICABLE,
	LONG,
	MANLY
}

class BodyDescription{
	#character: Character;
	constructor(character:Character){
		this.#character = character;
	}

	static get eyesColorsString():string[]{
		return [
			'brown',
			'grey',
			'green',
			'blue'
		];
	}

	get eyesColorString():string{
		const eyeColor = this.#character.eyecolor;
		return BodyDescription.eyesColorsString[eyeColor];
	}

	static get eyesSizesString():string[]{
		return [
			'small',
			null,
			'large',
			'huge'
		]
	}

	get eyesSizeString():string{
		const eyesize = this.#character.eyesize;
		return BodyDescription.eyesSizesString[eyesize];
	}

	get eyesString():string{
		return [this.eyesSizeString,this.eyesColorString].join(' ');
	}

	static get hairColorsString():string[]{
		return [
			'black',
			'brown',
			'ginger',
			'blonde',
			'scarlet',
			'dark blue',
			'blue',
			'light blue',
			'dark green',
			'green',
			'light green',
			'dark pink',
			'pink',
			'light pink',
			'dark purple',
			'purple',
			'light purple',
			'light orange',
			'dark red',
			'cherry red',
			'turquoise',
			'carrot orange',
			'dark orange',
		];
	}

	get hairColorString():string{
		const hairColor = this.#character.hairColor ?? 0;
		return BodyDescription.hairColorsString[hairColor];
	}

	static get hairLengthsString():string[]{
		return [
				'extremly short',
				'short',
				'medium-length',
				'shoulder-length',
				'long',
				'very long',
				'extremely long',
				'incredibly long'
			]
	}

	get hairLengthString():string{
		const hairLength = this.#character.hairLengthCategory ?? 0;
		return BodyDescription.hairLengthsString[hairLength];
	}



	//#region  Deprecated
		/*static get(bodypart:string,character:PlayerCharacter=undefined):string{
			character ??= State.variables.pc;
			let attributes:string[] = [];
			switch (bodypart) {
				case 'eyes':		attributes = this.#eye_attributes(character);						break;
				case 'hair':		attributes = this.#hair_attributes(character);						break;
				case 'hairColor':	attributes = [this.hair_color(character.hairColor)];				break;
				default:
					attributes =[`bodypart not found in BodyDescription.get(): ${bodypart}`];
			}

			return attributes.join(' ');
		}

		static getCategoryIndex(bodypart:string,character:PlayerCharacter=undefined):number{
			character ??= State.variables.pc;

			switch (bodypart) {
				case 'hairLength': return this.hair_length2category(character.hairLength);
			}
		}

		//#region Eyes
			static #eye_attributes(character:PlayerCharacter):string[]{
				return [
					this.eye_size(character.eyesize),
					this.eye_color(character.eyecolor),				
				];
			}

			

			static eye_color(eyeColor:number):string{
				return this.eye_colors[eyeColor];
			}

			static eye_size(eyesize:number):string{
				return this.eye_sizes[eyesize];
			}

		//#endregion

		//#region Hair
			static #hair_attributes(character:PlayerCharacter):string[]{
				return [
					this.hair_length(character.hairLength),
					this.hair_color(character.hairColor),				
				];
			}

			

			static hair_color(hairColor:number):string{
				const existingColors = this.hair_colors;
				if(existingColors[hairColor])
					return existingColors[hairColor];	
				return 'strangely-coloured';
			}

			


			static hair_length(length:number):string{
				const lengthCategory = this.hair_length2category(length);
				const existingLenghts = this.hair_lengths;
				if(existingLenghts[lengthCategory])
					return existingLenghts[lengthCategory];	
				return 'weird-lengthed';		
			}
		//#endregion

		*/
	//#endregion

}

setup.BodyDescription = BodyDescription;
