import IMatchReference = require('./../../interfaces/matchlist/match-reference');

class MatchReference 
{
    constructor(matchReferenceData : IMatchReference) {
        if(matchReferenceData.lane)
            this.lane = matchReferenceData.lane;
        this.gameId = matchReferenceData.gameId;
        this.champion = matchReferenceData.champion;
        this.platformId = matchReferenceData.platformId;
        this.season = matchReferenceData.season;
        this.queue = matchReferenceData.queue;
        if(matchReferenceData.role)
            this.role = matchReferenceData.role;
        this.timestamp = matchReferenceData.timestamp;
    }

    public lane?: string;
    public gameId: number;
    public champion: number;
    public platformId: string;

    toObject() : IMatchReference {
        return {
            lane: (this.lane) ? this.lane : undefined,
            gameId: this.gameId,
            champion: this.champion,
            platformId: this.platformId,
            season: this.season,
            queue: this.queue,
            role: (this.role) ? this.role : undefined,
            timestamp: this.timestamp
        };
    }
}

export = MatchReference;
    public season: number;
    public queue: number;
    public role?: string;
    public timestamp: number;

