const Promise = require('bluebird');
const CorneliusAction = require('./CorneliusAction');

/**
 * Represents Cornelius module.
 * @private
 */
class Cornelius {
    /**
     * Makes Cornelius functions available.
     */
    constructor() {
    }

    /**
     * @name cornelius.player
     * @description Searches for players or gets individual player details.
     *
     * `action` should be a string, and determines what player data is requested
     * and returned. The table below details all valid operations.
     *
     * |    Action  |  Options  |   Description |
     * | ------------- | --------- | ------------- |
     * | `search`  | `query`  | Searches for players.      |
     * | `details` | `id`     | Gets details for a player, or players.    |
     * | `stats`   | `id`, `season`, `type` | Get stats for a player, or players. |
     *
     *
     * The `details` and `stats` operations also accept an array of player IDs.
     *
     *
     * @summary Get player information.
     * @public
     * @param {string} action
     * @param {object} options
     * @param {string} [options.query]
     * @param {string[]} [options.id]
     * @param {string|number} [options.season]
     * @param {boolean} [options.prune=true]
     * @return {Promise}
     * @example <caption>Search for an active player</caption>
     * cornelius.player('search', {
     *  query: 'wright',
     * }).then(data => console.log(data)).catch(err => console.log(err));
     * @example <caption>Get player details</caption>
     * cornelius.player('details', {
     *  id: 493316,
     * }).then(data => console.log(data)).catch(err => console.log(err));
     * @example <caption>Get player stats</caption>
     * cornelius.player('stats', {
     *  id: 493316,
     * }).then(data => console.log(data)).catch(err => console.log(err));
     */
    player(action, options) {
        return new Promise((resolve, reject) => {
            const corneliusAction = new CorneliusAction(action, options);
            corneliusAction
                .on(`${action}:complete`, (data) => resolve(data))
                .on('error', (error) => reject(error));
            corneliusAction.execute();
        });
    }
}

module.exports = new Cornelius();

@@ -1968,16 +1968,719 @@
 sAction(
+'player', action, options);%0A            corneliusAction%0A                .on(%60$%7Baction%7D:complete%60, (data) =%3E resolve(data))%0A                .on('error', (error) =%3E reject(error));%0A            corneliusAction.execute();%0A        %7D);%0A    %7D%0A%0A    /**%0A     * @name cornelius.team%0A     * @description Searches for teams, or gets individual team details.%0A     *%0A     * %60action%60 should be a string,and determines what team data is requested and returned.%0A     *%0A     * @public%0A     * @param %7Bstring%7D action%0A     * @param %7Bobject%7D options%0A     * @return %7BPromise%7D%0A     */%0A    team(action, options) %7B%0A        return new Promise((resolve, reject) =%3E %7B%0A            const corneliusAction = new CorneliusAction('team', 
 action, 

add team method