package com.micer.easyball.pojo.Dto;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.micer.easyball.pojo.GamePlayer;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.jetbrains.annotations.NotNull;
import org.springframework.security.core.parameters.P;

import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class PlayerDto {

    /**
     * 球员ID
     */
    private String playerId;

    /**
     * 球员名
     */
    private String playerName;

    /**
     * 出场数
     */
    private Long appearance;

    /**
     * MVP数
     */
    private Long mvp;

    /**
     * 进球数
     */
    private Long goal;

    /**
     * 助攻数
     */
    private Long assist;

    public PlayerDto(@NotNull GamePlayer gamePlayer)
    {
        this.setPlayerId(gamePlayer.getPlayerId());
        this.setAppearance(1L);
        if (gamePlayer.getIsMVP())
        {
            this.setMvp(1L);
        } else
        {
            this.setMvp(0L);
        }
        this.setGoal(gamePlayer.getGoal());
        this.setAssist(gamePlayer.getAssist());
    }

}
