/// <reference path="../ContentDescription.ts" />
/// <reference path="CombatPokeUnit.ts" />
/// <reference path="CombatUnit.ts" />
/**
 * Quick Cheat Sheet of markers!

 */
class CombatPokeDescription extends ContentDescription {
    public static DESCRIPTIONS = [];

    public constructor (name : string) {
        super(name, new ContentGroup());
        CombatPokeDescription.DESCRIPTIONS.push(this);
    }

    public setDescriptionFunction (descriptionFor : (aggressor : any, target : any, markers : Array<any>) => Say) {
        let finalFunction = (description : CombatPokeDescription, group : ContentGroup) => {
            // Combat only has one unit
            let unit = <CombatPokeUnit> group.getUnit(0);
            return descriptionFor (unit.getAggressor().nouns[0], unit.getTarget().nouns[0], unit.getMarkers());
        }
        this.description = finalFunction;
        return this;
    }

    public addUnit () {
        let unit = new CombatPokeUnit();
        (<ContentGroup> this.group).addUnit(unit);
        return unit;
    }

    public static getDescription (target : ContentGroup) {
        return ContentDescription.pickDescriptions(CombatPokeDescription.DESCRIPTIONS, target);
    }
}