package com.micer.easyball.pojo.Dto;

import com.micer.easyball.pojo.Game;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class GameDto extends Game
{
    /**
     * 我方球队名
     */
    private String ourTeamName;

    /**
     * 赛事名
     */
    private String eventName;

    /**
     * 出场球员名单
     */
    private List<GamePlayerDto> playerList;

    /**
     * 比赛照片路径
     */
    private List<String> imagePathList;

    /**
     * 比赛日期时间戳
     */
    private Long timestamp;

    public GameDto(Game game)
    {
        this.setId(game.getId());
        this.setYear(game.getYear());
        this.setDate(game.getDate());
        this.setOurTeamId(game.getOurTeamId());
        this.setOpponentTeamName(game.getOpponentTeamName());
        this.setOurScore(game.getOurScore());
        this.setOpponentScore(game.getOpponentScore());
        this.setEventId(game.getEventId());
        this.setVenue(game.getVenue());
        this.setOurTeamName("");
        this.playerList = new ArrayList<>();
        this.imagePathList = new ArrayList<>();
        this.timestamp = this.getDate().getTime();
    }
}
