///<reference path="../ContentAtom.ts"/>
///<reference path="../ContentNounSimple.ts"/>
/**
 * This atom should be used in place of the default atom when handling Annoying people.
 * Do note that any aggressive action is automatically Annoying.
 */
class ContentAtomAnnoy extends ContentAtom {
    /**
     * Only one of the following markers appears at once. Will always contain one of those.
     */
    public static TYPE_LOW = new ContentNounSimple("LOW ANNOYING LEVEL");
    public static TYPE_MEDIUM = new ContentNounSimple("MEDIUM ANNOYING LEVEL");
    public static TYPE_HIGH = new ContentNounSimple("HIGH ANNOYING LEVEL");

    /**
     * Only one of the following markers appears at once. Will always contain one of those.
     */
    public static RESULT_FRIENDLY = new ContentNounSimple("TARGET IS STILL FRIENDLY");
    public static RESULT_PISSED = new ContentNounSimple("TARGET IS GETTING PISSED OFF");
    public static RESULT_HOSTILE = new ContentNounSimple("TARGET IS NOW HOSTILE");


    public annoyer : any;
    public target : any;
    public markers : ContentAtom = new ContentAtom();

    constructor (attacker : any, target : any, markers : Array<ContentNounSimple> = []) {
        super();
        this.annoyer = attacker;
        this.target = target;
        this.markers.addNoun(...markers);
    }

    public compareAgainst (other : ContentAtom) {
        if (other instanceof ContentAtomAnnoy) {
            return (
                ContentAtom.compareNoun(this.annoyer, other.annoyer) &&
                ContentAtom.compareNoun(this.target, other.target) &&
                this.markers.compareAgainst(other.markers)
            );
        }
        return false;
    }

    public getAtomPriority () {
        return (
            ContentAtom.weightNoun(this.annoyer) +
            ContentAtom.weightNoun(this.target) +
            this.markers.getAtomPriority()
        );
    }
}