Updates
This commit is contained in:
14
DCGEngine.Database/Models/BaseEntity.cs
Normal file
14
DCGEngine.Database/Models/BaseEntity.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using DCGEngine.Database.Interfaces;
|
||||
|
||||
namespace DCGEngine.Database.Models;
|
||||
|
||||
public class BaseEntity<TKey> : ITimeTrackedEntity, IDbTrackedEntity
|
||||
{
|
||||
[Key]
|
||||
public virtual TKey Id { get; set; }
|
||||
|
||||
public DateTime? DateCreated { get; set; }
|
||||
|
||||
public DateTime? DateUpdated { get; set; }
|
||||
}
|
||||
27
DCGEngine.Database/Models/CardEntry.cs
Normal file
27
DCGEngine.Database/Models/CardEntry.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
namespace DCGEngine.Database.Models;
|
||||
|
||||
/// <summary>
|
||||
/// A card within the system.
|
||||
/// </summary>
|
||||
public abstract class CardEntry : BaseEntity<long>
|
||||
{
|
||||
/// <summary>
|
||||
/// The name of this card used internally, to separate it from any localization key stored.
|
||||
/// </summary>
|
||||
public virtual string InternalName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The offensive power of this card.
|
||||
/// </summary>
|
||||
public virtual int? Attack { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The defensive power of this card.
|
||||
/// </summary>
|
||||
public virtual int? Defense { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// How much of the primary resource (ie mana, energy) does this card cost to play in a match.
|
||||
/// </summary>
|
||||
public virtual int? PrimaryResourceCost { get; set; }
|
||||
}
|
||||
17
DCGEngine.Database/Models/DeckEntry.cs
Normal file
17
DCGEngine.Database/Models/DeckEntry.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
namespace DCGEngine.Database.Models;
|
||||
|
||||
/// <summary>
|
||||
/// A deck consisting of multiple <see cref="CardEntry"/> stored in the DB.
|
||||
/// </summary>
|
||||
public abstract class DeckEntry : BaseEntity<long>
|
||||
{
|
||||
/// <summary>
|
||||
/// How this deck is referred to internally.
|
||||
/// </summary>
|
||||
public virtual string InternalName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The cards present in this deck.
|
||||
/// </summary>
|
||||
public virtual List<CardEntry> Cards { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user