/*
 * 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 entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.validation.constraints.NotNull;

/**
 *
 * @author install1
 */
@Entity
public class Player implements Serializable {

    public Player(String steamID, String name) {
        this.steamID = steamID;
        this.name = name;
    }

    public Player() {
    }

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    private String steamID;
    @Basic(optional = false)
    @NotNull
    private String name;
    @Basic(optional = false)
    @NotNull
    private String avatar;
    private int rank = 0;
    private int playerPoints = 0;
    private int timesCount = 0;
    @ManyToMany(mappedBy = "players", cascade = {CascadeType.MERGE, CascadeType.PERSIST})
    private List<UrlBanners> urlBanners = new ArrayList();

    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 void addPlayerPoints(int points) {
        this.playerPoints += points;
    }

    public int getTimesCount() {
        return timesCount;
    }

    public void setTimesCount(int timesCount) {
        this.timesCount = timesCount;
    }

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

    public void setUrlBanners(List<UrlBanners> urlBanners) {
        this.urlBanners = urlBanners;
    }

}
