- HexSides now stores radius+1 (for hex coordinate math); HexPolygonSides stores the corner count (3–10) - Board.IsTemplateBased: template boards use tile existence for IsInBounds/GetNeighbors instead of the hexagonal formula, so N-gon and other custom shapes work correctly - HexGrid.AllNeighbors: unfiltered 6-neighbor generator for template board use - ApplyHexConfig: generates a regular N-gon on the hex canvas — tiles outside the polygon are marked absent; N corner zones auto-generated for each player count 2..N - Admin builder UI: separate "Polygon Sides" (3–10 corners) and "Radius (tiles)" inputs - BoardTemplate entity and migration: HexPolygonSides column added to board_templates - BoardTemplateDto exposes HexPolygonSides to client Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
539 lines
19 KiB
C#
539 lines
19 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
using SOR.Database.Contexts;
|
|
|
|
#nullable disable
|
|
|
|
namespace SOR.Database.Migrations.Game
|
|
{
|
|
[DbContext(typeof(GameDbContext))]
|
|
partial class GameDbContextModelSnapshot : ModelSnapshot
|
|
{
|
|
protected override void BuildModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasDefaultSchema("game")
|
|
.HasAnnotation("ProductVersion", "8.0.0")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
|
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("SOR.Database.Entities.Game.BoardTemplate", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("GridType")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<int>("Height")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("HexPolygonSides")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("HexSides")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<bool>("IsAvailableForCustom")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<bool>("IsAvailableForRanked")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<bool>("IsEnabled")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<int>("MaxPlayers")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("MinPlayers")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("StartingZonesJson")
|
|
.IsRequired()
|
|
.HasColumnType("jsonb");
|
|
|
|
b.Property<string>("TilesJson")
|
|
.IsRequired()
|
|
.HasColumnType("jsonb");
|
|
|
|
b.Property<DateTimeOffset>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<int>("Width")
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("IsEnabled");
|
|
|
|
b.ToTable("board_templates", "game");
|
|
});
|
|
|
|
modelBuilder.Entity("SOR.Database.Entities.Game.CustomLobby", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("AdditionalPlayersJson")
|
|
.HasColumnType("text")
|
|
.HasColumnName("additional_players_json");
|
|
|
|
b.Property<int?>("BoardHeightOverride")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("BoardShapeOverride")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<Guid?>("BoardTemplateIdOverride")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<int?>("BoardWidthOverride")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<bool?>("DiscardOnMaxHandOverride")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<int?>("DrawPerTurnOverride")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<bool?>("FirstPlayerSkipsDrawOverride")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<string>("GameMode")
|
|
.IsRequired()
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("text")
|
|
.HasDefaultValue("FFA")
|
|
.HasColumnName("game_mode");
|
|
|
|
b.Property<Guid?>("GameSessionId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid?>("GuestAccountId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid?>("GuestDeckId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("GuestFirstTurnPref")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<bool>("GuestReady")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<int?>("HandSizeCapOverride")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int?>("HexSidesOverride")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<Guid>("HostAccountId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("HostDeckId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("HostFirstTurnPref")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<bool>("HostReady")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<int?>("MaxArchTier1Override")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int?>("MaxDeckSizeOverride")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("MaxPlayers")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int?>("MinDeckSizeOverride")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int?>("MpBuffOverride")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<int?>("OpeningHandSizeOverride")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("Password")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<int?>("SpAccumulationPerTurnOverride")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int?>("SpCapOverride")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<bool?>("SpHasCapOverride")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<int?>("StartingRandomTilePctOverride")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("Status")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("TeamAssignmentsJson")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<int>("TeamCount")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer")
|
|
.HasDefaultValue(1)
|
|
.HasColumnName("team_count");
|
|
|
|
b.Property<int?>("TimeLimitMinutesOverride")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int?>("TurnLimitOverride")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int?>("TurnTimerSecondsOverride")
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("HostAccountId");
|
|
|
|
b.HasIndex("Status", "CreatedAt");
|
|
|
|
b.ToTable("custom_lobbies", "game");
|
|
});
|
|
|
|
modelBuilder.Entity("SOR.Database.Entities.Game.GameActionLog", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("ActionType")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<Guid>("ActorAccountId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("GameSessionId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTimeOffset>("OccurredAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("PayloadJson")
|
|
.HasColumnType("jsonb")
|
|
.HasColumnName("payload");
|
|
|
|
b.Property<string>("ResultJson")
|
|
.HasColumnType("jsonb")
|
|
.HasColumnName("result");
|
|
|
|
b.Property<int>("SequenceNumber")
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("ActorAccountId");
|
|
|
|
b.HasIndex("GameSessionId", "SequenceNumber")
|
|
.IsUnique();
|
|
|
|
b.ToTable("action_logs", "game");
|
|
});
|
|
|
|
modelBuilder.Entity("SOR.Database.Entities.Game.GameRuleSet", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<int>("BoardHeight")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<Guid?>("BoardTemplateId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<int>("BoardWidth")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<bool>("DiscardOnMaxHand")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<int>("DrawPerTurn")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<bool>("FirstPlayerSkipsDraw")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<string>("GridType")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<int>("HandSizeCap")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("HexSides")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<bool>("IsCustomDefault")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<bool>("IsRankedDefault")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<int>("LoserOpReward")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("MaxArchTier1")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("MaxDeckSize")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("MinDeckSize")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("MpBuff")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<int>("OpeningHandSize")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("RankDiffOpMultiplierPct")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("SpAccumulationPerTurn")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("SpCap")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<bool>("SpHasCap")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<int>("StartingRandomTilePct")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("TimeLimitMinutes")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("TurnLimit")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("TurnTimerSeconds")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<DateTimeOffset>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<int>("WinnerOpReward")
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("IsCustomDefault");
|
|
|
|
b.HasIndex("IsRankedDefault");
|
|
|
|
b.ToTable("game_rule_sets", "game");
|
|
});
|
|
|
|
modelBuilder.Entity("SOR.Database.Entities.Game.GameSession", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("AdditionalPlayersJson")
|
|
.HasColumnType("text")
|
|
.HasColumnName("additional_players_json");
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<DateTimeOffset?>("EndedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("GameMode")
|
|
.IsRequired()
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("text")
|
|
.HasDefaultValue("FFA")
|
|
.HasColumnName("game_mode");
|
|
|
|
b.Property<DateTimeOffset?>("LastActionAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<int>("PlayerCount")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer")
|
|
.HasDefaultValue(2)
|
|
.HasColumnName("player_count");
|
|
|
|
b.Property<Guid>("PlayerOneAccountId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("PlayerOneDeckId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<bool>("PlayerOneReady")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<Guid>("PlayerTwoAccountId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("PlayerTwoDeckId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<bool>("PlayerTwoReady")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<string>("RuleSnapshotJson")
|
|
.HasColumnType("jsonb")
|
|
.HasColumnName("rule_snapshot");
|
|
|
|
b.Property<DateTimeOffset?>("StartedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("StateJson")
|
|
.HasColumnType("jsonb")
|
|
.HasColumnName("state");
|
|
|
|
b.Property<string>("Status")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("WinCondition")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<Guid?>("WinnerAccountId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("PlayerOneAccountId");
|
|
|
|
b.HasIndex("PlayerTwoAccountId");
|
|
|
|
b.HasIndex("Status", "CreatedAt");
|
|
|
|
b.ToTable("game_sessions", "game");
|
|
});
|
|
|
|
modelBuilder.Entity("SOR.Database.Entities.Game.LobbyPreset", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<Guid>("OwnerAccountId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("RulesJson")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("OwnerAccountId");
|
|
|
|
b.ToTable("lobby_presets", "game");
|
|
});
|
|
|
|
modelBuilder.Entity("SOR.Database.Entities.Game.MatchmakingEntry", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("AccountId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("DeckId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTimeOffset>("JoinedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<Guid?>("MatchedGameSessionId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<int>("RankScore")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<DateTimeOffset?>("ResolvedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("Status")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("AccountId", "Status");
|
|
|
|
b.HasIndex("Status", "RankScore");
|
|
|
|
b.ToTable("matchmaking_entries", "game");
|
|
});
|
|
|
|
modelBuilder.Entity("SOR.Database.Entities.Game.GameActionLog", b =>
|
|
{
|
|
b.HasOne("SOR.Database.Entities.Game.GameSession", "Session")
|
|
.WithMany("ActionLog")
|
|
.HasForeignKey("GameSessionId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Session");
|
|
});
|
|
|
|
modelBuilder.Entity("SOR.Database.Entities.Game.GameSession", b =>
|
|
{
|
|
b.Navigation("ActionLog");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|