using Common.Library;
using SQLite;

namespace Gready_Poang.EntityLayer;


[Table("GameRound")]

public class GameRound : EntityBase
{
    public GameRound()
    {
        _gameRoundId = 0;
        _gameRoundStartDate = DateTime.Now;
        _gameStatus = GamePointStatus.New;
        _gameRoundFinished = null;
    }

    private int _gameRoundId;
    private DateTime _gameRoundStartDate;
    private GamePointStatus _gameStatus;
    private DateTime? _gameRoundFinished;

    [Column("GameRoundFinished")]
    public DateTime? GameRoundFinished
    {
        get { return _gameRoundFinished; }
        set
        {
            _gameRoundFinished = value;
            RaisePropertyChanged(nameof(GameRoundFinished));
        }
    }

    [Column("GameRoundStartDate")]
    public DateTime GameRoundStartDate
    {
        get { return _gameRoundStartDate; }
        set
        {
            _gameRoundStartDate = value;
            RaisePropertyChanged(nameof(GameRoundStartDate));
        }
    }

    [Column("GameStatus")]
    public GamePointStatus GameStatus
    {
        get { return _gameStatus; }
        set
        {
            _gameStatus = value;
            RaisePropertyChanged(nameof(GameStatus));
        }
    }


    [PrimaryKey]
    [AutoIncrement]
    [Column("GameRoundId")]
    public int GameRoundId
    {
        get { return _gameRoundId; }
        set
        {
            _gameRoundId = value;
            RaisePropertyChanged(nameof(GameRoundId));
        }
    }

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


}
