/// <reference path="../Thing.ts" />
class Door extends Thing {
    public locked = false;
    public key : Thing;
    public destination : Room;

    constructor (name : string, destination : Room, unique = false) {
        super({name : name, unique : unique == true});
        this.destination = destination;
        this.fixedInPlace = true;
    }

    public setBreakable (damage : number) {
        this.breakableOn = damage;
        this.breakable = true;
        this.breaksTo = this;
    }

    public breakThrough () {
        this.locked = false;
        this.name = "Broken " + this.name;
    }
}