using Common.Library;

namespace Gready_Poang.EntityLayer;

public class RoundBuilderElement : EntityBase
{
    public RoundBuilderElement()
    {
        _participantId = 0;
        _participantName = string.Empty;
        _gameRoundRegNr = 0;
        _gameRegPoints = 0;
        _status = GamePointStatus.New;
        _gameRoundStartDate = DateTime.MinValue;
        _gameRoundId = 0;
        _gamePointId = 0;
    }

    private int _participantId;
    private string _participantName;
    private int _gameRoundRegNr;
    private int _gameRegPoints;
    private GamePointStatus _status;
    private DateTime _gameRoundStartDate;
    private int _gameRoundId;
    private int _gamePointId;

    public int ParticipantId
    {
        get { return _participantId; }
        set
        {
            _participantId = value;
            RaisePropertyChanged(nameof(ParticipantId));
        }
    }


    public string ParticipantName
    {
        get { return _participantName; }
        set
        {
            _participantName = value;
            RaisePropertyChanged(nameof(ParticipantName));
        }
    }


    public int GameRoundRegNr
    {
        get { return _gameRoundRegNr; }
        set
        {
            _gameRoundRegNr = value;
            RaisePropertyChanged(nameof(GameRoundRegNr));
        }
    }


    public int GameRegPoints
    {
        get { return _gameRegPoints; }
        set
        {
            _gameRegPoints = value;
            RaisePropertyChanged(nameof(GameRegPoints));
        }
    }


    public GamePointStatus Status
    {
        get { return _status; }
        set
        {
            _status = value;
            RaisePropertyChanged(nameof(Status));
            RaisePropertyChanged(nameof(StatusString));
        }
    }

    public string StatusString
    {
        get { return _status.ToString(); }
    }

    public DateTime GameRoundStartDate
    {
        get { return _gameRoundStartDate; }
        set
        {
            _gameRoundStartDate = value;
            RaisePropertyChanged(nameof(GameRoundStartDate));
            RaisePropertyChanged(nameof(GameRoundStartDateString));
        }
    }

    public string GameRoundStartDateString
    {
        get { return _gameRoundStartDate.ToString("yyyy-MM-dd"); }
    }

    public int GameRoundId
    {
        get { return _gameRoundId; }
        set
        {
            _gameRoundId = value;
            RaisePropertyChanged(nameof(GameRoundId));
        }
    }


    public int GamePointId
    {
        get { return _gamePointId; }
        set
        {
            _gamePointId = value;
            RaisePropertyChanged(nameof(GamePointId));
        }
    }


}
