Dungeon Builder Change
This commit is contained in:
@@ -513,6 +513,18 @@ public class DungeonPalette
|
||||
[MaxLength(256)]
|
||||
public string? Tags { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Optional allowed bucket IDs for generation filtering.
|
||||
/// JSON array of TileBucket.Id values.
|
||||
/// </summary>
|
||||
[Column(TypeName = "json")]
|
||||
public string? AllowedBucketIdsJson { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// If true, tiles must include the palette biome bucket.
|
||||
/// </summary>
|
||||
public bool EnforceBiomeBuckets { get; set; } = false;
|
||||
|
||||
// --- Template Collections (JSON arrays of IDs) ---
|
||||
|
||||
/// <summary>Floor tile template IDs</summary>
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace DataServer.Data.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// Bucket used for tile connectivity and filtering.
|
||||
/// </summary>
|
||||
[Table("tile_buckets")]
|
||||
public class TileBucket
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required, MaxLength(64)]
|
||||
public string Name { get; set; } = "";
|
||||
|
||||
/// <summary>Optional bucket category/type (e.g., "biome", "floor", "wall")</summary>
|
||||
[MaxLength(32)]
|
||||
public string? BucketType { get; set; }
|
||||
|
||||
[MaxLength(256)]
|
||||
public string? Description { get; set; }
|
||||
|
||||
public bool IsEnabled { get; set; } = true;
|
||||
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Explicit allow-list rule: Source bucket can connect to Target bucket.
|
||||
/// </summary>
|
||||
[Table("tile_bucket_rules")]
|
||||
public class TileBucketRule
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
|
||||
public int SourceBucketId { get; set; }
|
||||
|
||||
public int TargetBucketId { get; set; }
|
||||
|
||||
/// <summary>Optional weight for selection bias (1.0 = default)</summary>
|
||||
public float Weight { get; set; } = 1.0f;
|
||||
|
||||
[ForeignKey(nameof(SourceBucketId))]
|
||||
public TileBucket? SourceBucket { get; set; }
|
||||
|
||||
[ForeignKey(nameof(TargetBucketId))]
|
||||
public TileBucket? TargetBucket { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Join table: which buckets a tile definition belongs to.
|
||||
/// </summary>
|
||||
[Table("tile_definition_buckets")]
|
||||
public class TileDefinitionBucket
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
|
||||
public int TileDefinitionId { get; set; }
|
||||
|
||||
public int TileBucketId { get; set; }
|
||||
|
||||
[ForeignKey(nameof(TileDefinitionId))]
|
||||
public TileDefinition? TileDefinition { get; set; }
|
||||
|
||||
[ForeignKey(nameof(TileBucketId))]
|
||||
public TileBucket? TileBucket { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Saved stamp of multiple tile placements for fast painting.
|
||||
/// </summary>
|
||||
[Table("tile_stamps")]
|
||||
public class TileStamp
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required, MaxLength(64)]
|
||||
public string Name { get; set; } = "";
|
||||
|
||||
[MaxLength(256)]
|
||||
public string? Description { get; set; }
|
||||
|
||||
public int Width { get; set; } = 1;
|
||||
|
||||
public int Height { get; set; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// JSON array of placements: { x, y, tileDefinitionId, layer }
|
||||
/// </summary>
|
||||
[Column(TypeName = "json")]
|
||||
public string? TilesJson { get; set; }
|
||||
|
||||
public bool IsEnabled { get; set; } = true;
|
||||
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
@@ -108,6 +108,9 @@ public class TileDefinition
|
||||
/// <summary>Whether this blocks line of sight</summary>
|
||||
public bool BlocksLineOfSight { get; set; } = false;
|
||||
|
||||
/// <summary>Whether this tile can be interacted with</summary>
|
||||
public bool IsInteractable { get; set; } = false;
|
||||
|
||||
/// <summary>Layer for rendering order (0=ground, 1=floor decor, 2=walls, 3=ceiling)</summary>
|
||||
public int RenderLayer { get; set; } = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user