Dungeon Builder Phase 2

This commit is contained in:
dingo
2026-01-31 19:12:15 -05:00
parent 739c624b71
commit f0587254c5
10 changed files with 7526 additions and 131 deletions
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,186 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace SystemRevivalServer.Migrations
{
/// <inheritdoc />
public partial class BuilderChanges : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsInteractable",
table: "tile_definitions",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<string>(
name: "AllowedBucketIdsJson",
table: "dungeon_palettes",
type: "json",
nullable: true)
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<bool>(
name: "EnforceBiomeBuckets",
table: "dungeon_palettes",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.CreateTable(
name: "tile_buckets",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Name = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
BucketType = table.Column<string>(type: "varchar(32)", maxLength: 32, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
IsEnabled = table.Column<bool>(type: "tinyint(1)", nullable: false),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
UpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_tile_buckets", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "tile_stamps",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Name = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Width = table.Column<int>(type: "int", nullable: false),
Height = table.Column<int>(type: "int", nullable: false),
TilesJson = table.Column<string>(type: "json", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
IsEnabled = table.Column<bool>(type: "tinyint(1)", nullable: false),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
UpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_tile_stamps", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "tile_bucket_rules",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
SourceBucketId = table.Column<int>(type: "int", nullable: false),
TargetBucketId = table.Column<int>(type: "int", nullable: false),
Weight = table.Column<float>(type: "float", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_tile_bucket_rules", x => x.Id);
table.ForeignKey(
name: "FK_tile_bucket_rules_tile_buckets_SourceBucketId",
column: x => x.SourceBucketId,
principalTable: "tile_buckets",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_tile_bucket_rules_tile_buckets_TargetBucketId",
column: x => x.TargetBucketId,
principalTable: "tile_buckets",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "tile_definition_buckets",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
TileDefinitionId = table.Column<int>(type: "int", nullable: false),
TileBucketId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_tile_definition_buckets", x => x.Id);
table.ForeignKey(
name: "FK_tile_definition_buckets_tile_buckets_TileBucketId",
column: x => x.TileBucketId,
principalTable: "tile_buckets",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_tile_definition_buckets_tile_definitions_TileDefinitionId",
column: x => x.TileDefinitionId,
principalTable: "tile_definitions",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_tile_bucket_rules_SourceBucketId",
table: "tile_bucket_rules",
column: "SourceBucketId");
migrationBuilder.CreateIndex(
name: "IX_tile_bucket_rules_TargetBucketId",
table: "tile_bucket_rules",
column: "TargetBucketId");
migrationBuilder.CreateIndex(
name: "IX_tile_definition_buckets_TileBucketId",
table: "tile_definition_buckets",
column: "TileBucketId");
migrationBuilder.CreateIndex(
name: "IX_tile_definition_buckets_TileDefinitionId",
table: "tile_definition_buckets",
column: "TileDefinitionId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "tile_bucket_rules");
migrationBuilder.DropTable(
name: "tile_definition_buckets");
migrationBuilder.DropTable(
name: "tile_stamps");
migrationBuilder.DropTable(
name: "tile_buckets");
migrationBuilder.DropColumn(
name: "IsInteractable",
table: "tile_definitions");
migrationBuilder.DropColumn(
name: "AllowedBucketIdsJson",
table: "dungeon_palettes");
migrationBuilder.DropColumn(
name: "EnforceBiomeBuckets",
table: "dungeon_palettes");
}
}
}
File diff suppressed because it is too large Load Diff
+22
View File
@@ -0,0 +1,22 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace SystemRevivalServer.Migrations
{
/// <inheritdoc />
public partial class datachange : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}
+171
View File
@@ -1430,6 +1430,9 @@ namespace SystemRevivalServer.Migrations
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("AllowedBucketIdsJson")
.HasColumnType("json");
b.Property<string>("Biome")
.HasMaxLength(32)
.HasColumnType("varchar(32)");
@@ -1456,6 +1459,9 @@ namespace SystemRevivalServer.Migrations
b.Property<string>("DoorTemplateIdsJson")
.HasColumnType("json");
b.Property<bool>("EnforceBiomeBuckets")
.HasColumnType("tinyint(1)");
b.Property<string>("FloorTemplateIdsJson")
.HasColumnType("json");
@@ -2392,6 +2398,67 @@ namespace SystemRevivalServer.Migrations
b.ToTable("socket_names");
});
modelBuilder.Entity("DataServer.Data.Entities.TileBucket", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("BucketType")
.HasMaxLength(32)
.HasColumnType("varchar(32)");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)");
b.Property<string>("Description")
.HasMaxLength(256)
.HasColumnType("varchar(256)");
b.Property<bool>("IsEnabled")
.HasColumnType("tinyint(1)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64)");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("datetime(6)");
b.HasKey("Id");
b.ToTable("tile_buckets");
});
modelBuilder.Entity("DataServer.Data.Entities.TileBucketRule", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("SourceBucketId")
.HasColumnType("int");
b.Property<int>("TargetBucketId")
.HasColumnType("int");
b.Property<float>("Weight")
.HasColumnType("float");
b.HasKey("Id");
b.HasIndex("SourceBucketId");
b.HasIndex("TargetBucketId");
b.ToTable("tile_bucket_rules");
});
modelBuilder.Entity("DataServer.Data.Entities.TileDefinition", b =>
{
b.Property<int>("Id")
@@ -2425,6 +2492,9 @@ namespace SystemRevivalServer.Migrations
b.Property<bool>("IsEnabled")
.HasColumnType("tinyint(1)");
b.Property<bool>("IsInteractable")
.HasColumnType("tinyint(1)");
b.Property<bool>("IsWalkable")
.HasColumnType("tinyint(1)");
@@ -2483,6 +2553,29 @@ namespace SystemRevivalServer.Migrations
b.ToTable("tile_definitions");
});
modelBuilder.Entity("DataServer.Data.Entities.TileDefinitionBucket", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("TileBucketId")
.HasColumnType("int");
b.Property<int>("TileDefinitionId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("TileBucketId");
b.HasIndex("TileDefinitionId");
b.ToTable("tile_definition_buckets");
});
modelBuilder.Entity("DataServer.Data.Entities.TileMapSheet", b =>
{
b.Property<int>("Id")
@@ -2531,6 +2624,46 @@ namespace SystemRevivalServer.Migrations
b.ToTable("tilemap_sheets");
});
modelBuilder.Entity("DataServer.Data.Entities.TileStamp", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)");
b.Property<string>("Description")
.HasMaxLength(256)
.HasColumnType("varchar(256)");
b.Property<int>("Height")
.HasColumnType("int");
b.Property<bool>("IsEnabled")
.HasColumnType("tinyint(1)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64)");
b.Property<string>("TilesJson")
.HasColumnType("json");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("datetime(6)");
b.Property<int>("Width")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("tile_stamps");
});
modelBuilder.Entity("DataServer.Data.Entities.TileTemplate", b =>
{
b.Property<int>("Id")
@@ -3103,6 +3236,25 @@ namespace SystemRevivalServer.Migrations
b.Navigation("SpriteSheet");
});
modelBuilder.Entity("DataServer.Data.Entities.TileBucketRule", b =>
{
b.HasOne("DataServer.Data.Entities.TileBucket", "SourceBucket")
.WithMany()
.HasForeignKey("SourceBucketId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("DataServer.Data.Entities.TileBucket", "TargetBucket")
.WithMany()
.HasForeignKey("TargetBucketId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("SourceBucket");
b.Navigation("TargetBucket");
});
modelBuilder.Entity("DataServer.Data.Entities.TileDefinition", b =>
{
b.HasOne("DataServer.Data.Entities.TileMapSheet", "TileMapSheet")
@@ -3114,6 +3266,25 @@ namespace SystemRevivalServer.Migrations
b.Navigation("TileMapSheet");
});
modelBuilder.Entity("DataServer.Data.Entities.TileDefinitionBucket", b =>
{
b.HasOne("DataServer.Data.Entities.TileBucket", "TileBucket")
.WithMany()
.HasForeignKey("TileBucketId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("DataServer.Data.Entities.TileDefinition", "TileDefinition")
.WithMany()
.HasForeignKey("TileDefinitionId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("TileBucket");
b.Navigation("TileDefinition");
});
modelBuilder.Entity("DataServer.Data.Entities.TileTemplate", b =>
{
b.HasOne("DataServer.Data.Entities.TileDefinition", "PrimaryTileDefinition")