{"size": 643, "ext": "js", "max_stars_repo_path": "app/world/InventoryKey.js", "max_stars_repo_name": "dankuck/bookstore", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "app/world/InventoryKey.js", "max_issues_repo_name": "dankuck/bookstore", "max_issues_repo_issues_event_min_datetime": "2020-11-06T18:34:59.000Z", "max_issues_repo_issues_event_max_datetime": "2021-04-28T14:58:13.000Z", "max_forks_repo_path": "app/world/InventoryKey.js", "max_forks_repo_name": "dankuck/bookstore", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 5, "max_forks_count": null, "avg_line_length": 22.9642857143, "max_line_length": 69, "alphanum_fraction": 0.5645412131}
import InventoryBattery from './InventoryBattery';

export default class InventoryKey {

    constructor(data) {
        this.image = 'images/lobby-key.gif';
        this.selectable = true;
        Object.assign(this, data);
    }

    hoverName(selectedItem) {
        if (selectedItem) {
            return 'Use ' + selectedItem.name + ' with ' + this.name;
        } else {
            return this.name;
        }
    }
};

InventoryKey.registerReviver = function (reviver) {
    reviver.addClass(
        'InventoryKey',
        InventoryKey,
        (value) => new InventoryKey(value),
        (value) => { return {...value} },
    );
};
