Add project files.
This commit is contained in:
97
Gready_Poang.EntityLayer/EntityClasses/GamePoint.cs
Normal file
97
Gready_Poang.EntityLayer/EntityClasses/GamePoint.cs
Normal file
@ -0,0 +1,97 @@
|
||||
using Common.Library;
|
||||
using SQLite;
|
||||
|
||||
namespace GreadyPoang.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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
77
Gready_Poang.EntityLayer/EntityClasses/GameRound.cs
Normal file
77
Gready_Poang.EntityLayer/EntityClasses/GameRound.cs
Normal file
@ -0,0 +1,77 @@
|
||||
using Common.Library;
|
||||
using SQLite;
|
||||
|
||||
namespace GreadyPoang.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"); }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
75
Gready_Poang.EntityLayer/EntityClasses/Participant.cs
Normal file
75
Gready_Poang.EntityLayer/EntityClasses/Participant.cs
Normal file
@ -0,0 +1,75 @@
|
||||
using Common.Library;
|
||||
using SQLite;
|
||||
|
||||
namespace GreadyPoang.EntityLayer;
|
||||
[Table("Participants")]
|
||||
public class Participant : EntityBase
|
||||
{
|
||||
public Participant()
|
||||
{
|
||||
_firstName = string.Empty;
|
||||
_lastName = string.Empty;
|
||||
_email = string.Empty;
|
||||
}
|
||||
|
||||
private int _participantId;
|
||||
private string _firstName;
|
||||
private string _lastName;
|
||||
private string _email;
|
||||
|
||||
[PrimaryKey]
|
||||
[AutoIncrement]
|
||||
[Column("ParticipantId")]
|
||||
public int ParticipantId
|
||||
{
|
||||
get { return _participantId; }
|
||||
set
|
||||
{
|
||||
_participantId = value;
|
||||
RaisePropertyChanged(nameof(ParticipantId));
|
||||
}
|
||||
}
|
||||
|
||||
[Column("FirstName")]
|
||||
public string FirstName
|
||||
{
|
||||
get { return _firstName; }
|
||||
set
|
||||
{
|
||||
_firstName = value;
|
||||
RaisePropertyChanged(nameof(FirstName));
|
||||
}
|
||||
}
|
||||
|
||||
[Column("LastName")]
|
||||
public string LastName
|
||||
{
|
||||
get { return _lastName; }
|
||||
set
|
||||
{
|
||||
_lastName = value;
|
||||
RaisePropertyChanged(nameof(LastName));
|
||||
}
|
||||
}
|
||||
|
||||
[Column("Email")]
|
||||
public string Email
|
||||
{
|
||||
get { return _email; }
|
||||
set
|
||||
{
|
||||
_email = value;
|
||||
RaisePropertyChanged(nameof(Email));
|
||||
}
|
||||
}
|
||||
|
||||
public string FullName
|
||||
{
|
||||
get { return $"{FirstName} {LastName}"; }
|
||||
}
|
||||
|
||||
public string LastNameFirstName
|
||||
{
|
||||
get { return $"{LastName}, {FirstName}"; }
|
||||
}
|
||||
}
|
||||
11
Gready_Poang.EntityLayer/Enums/GamePointStatus.cs
Normal file
11
Gready_Poang.EntityLayer/Enums/GamePointStatus.cs
Normal file
@ -0,0 +1,11 @@
|
||||
namespace GreadyPoang.EntityLayer;
|
||||
|
||||
public enum GamePointStatus
|
||||
{
|
||||
New = 0,
|
||||
InProgress = 1,
|
||||
Completed = 2,
|
||||
Cancelled = 3,
|
||||
Winning = 4,
|
||||
Winner = 5
|
||||
}
|
||||
22
Gready_Poang.EntityLayer/Gready_Poang.EntityLayer.csproj
Normal file
22
Gready_Poang.EntityLayer/Gready_Poang.EntityLayer.csproj
Normal file
@ -0,0 +1,22 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>
|
||||
net9.0-android;
|
||||
net9.0-ios;
|
||||
net9.0-maccatalyst;
|
||||
net9.0-windows10.0.19041
|
||||
</TargetFrameworks>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Common.Library\Common.Library.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="sqlite-net-pcl" Version="1.9.172" />
|
||||
<PackageReference Include="SQLitePCLRaw.bundle_green" Version="2.1.11" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
55
Gready_Poang.EntityLayer/HelperEntities/PlayerColumn.cs
Normal file
55
Gready_Poang.EntityLayer/HelperEntities/PlayerColumn.cs
Normal file
@ -0,0 +1,55 @@
|
||||
using Common.Library;
|
||||
|
||||
namespace GreadyPoang.EntityLayer;
|
||||
|
||||
public class PlayerColumn : EntityBase
|
||||
{
|
||||
public PlayerColumn()
|
||||
{
|
||||
_playerName = string.Empty;
|
||||
_values = new List<string>();
|
||||
}
|
||||
|
||||
|
||||
private int _playerId;
|
||||
private string _playerName;
|
||||
private List<string> _values;
|
||||
public string PlayerName
|
||||
{
|
||||
get { return _playerName; }
|
||||
set
|
||||
{
|
||||
_playerName = value;
|
||||
RaisePropertyChanged(nameof(PlayerName));
|
||||
}
|
||||
}
|
||||
public List<string> Values
|
||||
{
|
||||
get { return _values; }
|
||||
set
|
||||
{
|
||||
_values = value;
|
||||
RaisePropertyChanged(nameof(Values));
|
||||
}
|
||||
}
|
||||
|
||||
public int PlayerId
|
||||
{
|
||||
get { return _playerId; }
|
||||
set
|
||||
{
|
||||
_playerId = value;
|
||||
RaisePropertyChanged(nameof(PlayerId));
|
||||
}
|
||||
}
|
||||
|
||||
private int _playerPoints;
|
||||
|
||||
public int PlayerPoints
|
||||
{
|
||||
get { return _playerPoints; }
|
||||
set { _playerPoints = value; }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
126
Gready_Poang.EntityLayer/HelperEntities/RoundBuilderElement.cs
Normal file
126
Gready_Poang.EntityLayer/HelperEntities/RoundBuilderElement.cs
Normal file
@ -0,0 +1,126 @@
|
||||
using Common.Library;
|
||||
|
||||
namespace GreadyPoang.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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
56
Gready_Poang.EntityLayer/HelperEntities/RoundBuilderGroup.cs
Normal file
56
Gready_Poang.EntityLayer/HelperEntities/RoundBuilderGroup.cs
Normal file
@ -0,0 +1,56 @@
|
||||
using Common.Library;
|
||||
|
||||
namespace GreadyPoang.EntityLayer;
|
||||
|
||||
public class RoundBuilderGroup : EntityBase
|
||||
{
|
||||
public RoundBuilderGroup()
|
||||
{
|
||||
_gameRoundId = 0;
|
||||
_gameRoundStartDate = DateTime.MinValue;
|
||||
_status = GamePointStatus.New;
|
||||
_elements = new List<RoundBuilderElement>();
|
||||
}
|
||||
private int _gameRoundId;
|
||||
private DateTime _gameRoundStartDate;
|
||||
private GamePointStatus _status;
|
||||
private List<RoundBuilderElement> _elements;
|
||||
public int GameRoundId
|
||||
{
|
||||
get { return _gameRoundId; }
|
||||
set
|
||||
{
|
||||
_gameRoundId = value;
|
||||
// No need to raise property changed for this example
|
||||
}
|
||||
}
|
||||
public DateTime GameRoundStartDate
|
||||
{
|
||||
get { return _gameRoundStartDate; }
|
||||
set
|
||||
{
|
||||
_gameRoundStartDate = value;
|
||||
// No need to raise property changed for this example
|
||||
}
|
||||
}
|
||||
public GamePointStatus Status
|
||||
{
|
||||
get { return _status; }
|
||||
set
|
||||
{
|
||||
_status = value;
|
||||
// No need to raise property changed for this example
|
||||
}
|
||||
}
|
||||
|
||||
public List<RoundBuilderElement> Elements
|
||||
{
|
||||
get { return _elements; }
|
||||
set
|
||||
{
|
||||
_elements = value;
|
||||
RaisePropertyChanged(nameof(Elements));
|
||||
// No need to raise property changed for this example
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user