/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package DTO;

import entity.Player;
import entity.UrlBanners;
import static facade.Facade.convertSteamIdToCommunityId;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author install1
 */
public class PlayerDTO {

    private String steamID64;
    private String steamID;
    private String name;

    public String getSteamID64() {
        return steamID64;
    }

    public void setSteamID64(String steamID64) {
        this.steamID64 = steamID64;
    }

    public String getSteamID() {
        return steamID;
    }

    public void setSteamID(String steamID) {
        this.steamID = steamID;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAvatar() {
        return Avatar;
    }

    public void setAvatar(String Avatar) {
        this.Avatar = Avatar;
    }

    public int getRank() {
        return Rank;
    }

    public void setRank(int Rank) {
        this.Rank = Rank;
    }

    public int getPlayerPoints() {
        return PlayerPoints;
    }

    public void setPlayerPoints(int PlayerPoints) {
        this.PlayerPoints = PlayerPoints;
    }

    public int getTimes() {
        return Times;
    }

    public void setTimes(int Times) {
        this.Times = Times;
    }

    public List<String> getUrlBanners() {
        return UrlBanners;
    }

    public void setUrlBanners(List<String> UrlBanners) {
        this.UrlBanners = UrlBanners;
    }
    private String Avatar;
    private int Rank;
    private int PlayerPoints;
    private int Times;
    private List<String> UrlBanners = new ArrayList();

    public PlayerDTO(String steamID, String name, String Avatar, int Rank, int PlayerPoints, int Times) {
        this.steamID = steamID;
        this.name = name;
        this.Avatar = Avatar;
        this.Rank = Rank;
        this.PlayerPoints = PlayerPoints;
        this.Times = Times;
    }

    public PlayerDTO() {
    }

    public PlayerDTO(Player player) {
        this.steamID = player.getSteamID();
        this.steamID64 = String.valueOf(convertSteamIdToCommunityId(player.getSteamID()));
        this.name = player.getName();
        this.Avatar = player.getAvatar();
        this.Rank = player.getRank();
        this.PlayerPoints = player.getPlayerPoints();
        this.Times = player.getTimesCount();
        List<UrlBanners> urlBanners = player.getUrlBanners();
        for (UrlBanners urlbanners : urlBanners) {
            this.UrlBanners.add(urlbanners.getBadgeUrl());
        }
    }
}
