"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Player = void 0;
class Player {
    constructor(data, map, G) {
        this.apiercing = 0;
        this.level = 1;
        this.rpiercing = 0;
        this.s = {};
        this.c = {};
        this.q = {};
        this.G = G;
        this.map = map;
        if (!data.npc)
            this.damage_type = this.G.classes[data.ctype].damage_type;
        this.updateData(data);
    }
    updateData(data) {
        if (this.id !== undefined && this.id !== data.id)
            throw Error("The entity's ID does not match");
        for (const key in data)
            this[key] = data[key];
    }
    isFriendly(bot) {
        if (bot.owner == this.owner)
            return true;
        if (bot.party == this.party)
            return true;
        return false;
    }
}
exports.Player = Player;
//# sourceMappingURL=Player.js.map