using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Sequence.Entities;

public class DbContext : IdentityDbContext<User, IdentityRole<Guid>, Guid>
{
    public DbContext(DbContextOptions<DbContext> options) : base(options) { }

    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        base.OnModelCreating(modelBuilder);

        // generate two source decks
        var deck1 = CardUtility.GenerateCards();
        var deck2 = CardUtility.GenerateCards();

        var cards = deck1.Concat(deck2);

        modelBuilder.Entity<Card>().HasData(cards);
    }

    public DbSet<Card> Cards { get; set; }
    public DbSet<PlayerCard> PlayerCards { get; set; }
    public DbSet<DeckCard> DeckCards { get; set; }
    public DbSet<HandCard> HandCards { get; set; }
    public DbSet<Match> Matches { get; set; }
    public DbSet<Player> Players { get; set; }

}