import { CanPlayIn, CanPlayOut, CanPlaySpin, CanPlayWin } from '../types/Entity';
import { ITrackEntry } from '../types/ITrackEntry';
import ReelSymbol from './ReelSymbol';

/**
 * @class ExpandedSymbol
 * @extends ReelSymbol
 * @implements CanPlayWin
 * @implements CanPlayIn
 * @implements CanPlayOut
 * @implements CanPlaySpin
 * @description Represents an expanded symbol in a slot machine game that can play various animations such as spin, in, and out.
 */
export default class ExpandedSymbol extends ReelSymbol implements CanPlayWin, CanPlayIn, CanPlayOut, CanPlaySpin
{
    reelIndex: number;
    /**
     * Triggers the spin animation for the symbol.
     * @returns {ITrackEntry} The track entry of the animation.
     */
    public spin(): ITrackEntry
    {
        return this.spine.state.setAnimation(0, 'spin', false);
    }

    /**
     * Sets the animation state to 'in' and returns the track entry.
     * @returns {ITrackEntry} The track entry for the 'in' animation.
     */
    public in(): ITrackEntry
    {
        return this.spine.state.setAnimation(0, 'in', false);
    }

    /**
     * Sets the animation state to 'out' and returns the track entry.
     * @returns {ITrackEntry} The track entry of the animation.
     */
    public out(): ITrackEntry
    {
        return this.spine.state.setAnimation(0, 'out', false);
    }
}
