using Common.Library;
using SQLite;

namespace Gready_Poang.EntityLayer;
[Table("GamePoint")]
public class GamePoint : EntityBase
{
    public GamePoint()
    {
        _gamePointId = 0;
        _participantId = 0;
        _gameRoundId = 0;
        _gameDate = DateTime.Now;
        _gameRoundRegNr = 0;
        _gameRegPoints = 0;
    }

    private int _gamePointId;
    private int _participantId;
    private int _gameRoundId;
    private DateTime _gameDate;
    private int _gameRoundRegNr;
    private int _gameRegPoints;

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

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

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

    // GameRoundRegNr räknas upp när en spelare får en ny gamepoint inlagd
    // Alltså hans/hennes senaste i samma runda uppräknad med 1

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

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



}
