Class leader fixes

This commit is contained in:
gamer147
2026-05-26 10:01:37 -04:00
parent b6966ece6e
commit 9090086a47
12 changed files with 2861 additions and 81 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,38 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace SVSim.Database.Migrations
{
/// <inheritdoc />
public partial class DropDefaultLeaderSkinSettings : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "DefaultLeaderSkinSettings");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "DefaultLeaderSkinSettings",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false),
ClassId = table.Column<int>(type: "integer", nullable: false),
DateCreated = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
DateUpdated = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
IsRandomLeaderSkin = table.Column<int>(type: "integer", nullable: false),
LeaderSkinId = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_DefaultLeaderSkinSettings", x => x.Id);
});
}
}
}

View File

@@ -824,31 +824,6 @@ namespace SVSim.Database.Migrations
b.ToTable("DefaultDecks");
});
modelBuilder.Entity("SVSim.Database.Models.DefaultLeaderSkinSettingEntry", b =>
{
b.Property<int>("Id")
.HasColumnType("integer");
b.Property<int>("ClassId")
.HasColumnType("integer");
b.Property<DateTime>("DateCreated")
.HasColumnType("timestamp with time zone");
b.Property<DateTime?>("DateUpdated")
.HasColumnType("timestamp with time zone");
b.Property<int>("IsRandomLeaderSkin")
.HasColumnType("integer");
b.Property<int>("LeaderSkinId")
.HasColumnType("integer");
b.HasKey("Id");
b.ToTable("DefaultLeaderSkinSettings");
});
modelBuilder.Entity("SVSim.Database.Models.DegreeEntry", b =>
{
b.Property<int>("Id")

View File

@@ -1,13 +0,0 @@
using SVSim.Database.Common;
namespace SVSim.Database.Models;
/// <summary>One row per class: which leader skin is default and whether random rotation is on.</summary>
public class DefaultLeaderSkinSettingEntry : BaseEntity<int>
{
public int ClassId { get => Id; set => Id = value; }
public int IsRandomLeaderSkin { get; set; }
public int LeaderSkinId { get; set; }
}

View File

@@ -41,9 +41,6 @@ public class GlobalsRepository : IGlobalsRepository
public Task<List<DefaultDeckEntry>> GetDefaultDecks() =>
_dbContext.DefaultDecks.AsNoTracking().ToListAsync();
public Task<List<DefaultLeaderSkinSettingEntry>> GetDefaultLeaderSkinSettings() =>
_dbContext.DefaultLeaderSkinSettings.AsNoTracking().ToListAsync();
public Task<ArenaSeasonConfig?> GetCurrentArenaSeason() =>
_dbContext.ArenaSeasons.AsNoTracking().FirstOrDefaultAsync(e => e.Id == 1);

View File

@@ -13,7 +13,6 @@ public interface IGlobalsRepository
Task<List<MyRotationAbilityEntry>> GetMyRotationAbilities();
Task<List<AvatarAbilityEntry>> GetAvatarAbilities();
Task<List<DefaultDeckEntry>> GetDefaultDecks();
Task<List<DefaultLeaderSkinSettingEntry>> GetDefaultLeaderSkinSettings();
Task<ArenaSeasonConfig?> GetCurrentArenaSeason();
Task<List<SpotCardEntry>> GetSpotCards();
Task<List<ReprintedCardEntry>> GetReprintedCards();

View File

@@ -44,7 +44,6 @@ public class SVSimDbContext : DbContext
public DbSet<MyRotationAbilityEntry> MyRotationAbilities => Set<MyRotationAbilityEntry>();
public DbSet<AvatarAbilityEntry> AvatarAbilities => Set<AvatarAbilityEntry>();
public DbSet<DefaultDeckEntry> DefaultDecks => Set<DefaultDeckEntry>();
public DbSet<DefaultLeaderSkinSettingEntry> DefaultLeaderSkinSettings => Set<DefaultLeaderSkinSettingEntry>();
public DbSet<ArenaSeasonConfig> ArenaSeasons => Set<ArenaSeasonConfig>();
public DbSet<SpotCardEntry> SpotCards => Set<SpotCardEntry>();
public DbSet<ReprintedCardEntry> ReprintedCards => Set<ReprintedCardEntry>();