72 lines
2.9 KiB
C#

using System.ComponentModel.DataAnnotations;
namespace PlotLine.Models;
public sealed class StoryMap
{
public int MapID { get; set; }
public int ProjectID { get; set; }
public int? ParentMapID { get; set; }
public Guid? ParentFeatureID { get; set; }
[Required, StringLength(200)] public string Name { get; set; } = "New map";
[Required, StringLength(40)] public string Kind { get; set; } = "Region";
public int Revision { get; set; }
public string AppearanceJson { get; set; } = "{}";
public string ReferenceJson { get; set; } = "{}";
}
public sealed class MapFeature
{
public int MapID { get; set; }
public Guid FeatureID { get; set; } = Guid.NewGuid();
[Required, StringLength(200)] public string Name { get; set; } = "";
[Required, StringLength(60)] public string Type { get; set; } = "Custom";
public string GeometryClass { get; set; } = "Marker";
public string Layer { get; set; } = "Places";
public double X { get; set; }
public double Y { get; set; }
public double Width { get; set; } = 48;
public double Height { get; set; } = 48;
public double Rotation { get; set; }
public int ZOrder { get; set; }
public bool IsPlaced { get; set; } = true;
public bool IsProvisional { get; set; } = true;
public bool IsLocked { get; set; }
public bool ShowLabel { get; set; } = true;
public double LabelX { get; set; }
public double LabelY { get; set; }
public int? LocationID { get; set; }
public bool CreateLocation { get; set; }
public int? FloorPlanID { get; set; }
public Guid? StartFeatureID { get; set; }
public Guid? EndFeatureID { get; set; }
public string GeometryJson { get; set; } = "{}";
[StringLength(4000)] public string? Notes { get; set; }
}
public sealed class MapRelationship
{
public int MapID { get; set; }
public Guid RelationshipID { get; set; } = Guid.NewGuid();
public Guid SourceID { get; set; }
public Guid TargetID { get; set; }
public string? Direction { get; set; }
public string? RelativeDistance { get; set; }
public decimal? MeasuredDistance { get; set; }
[StringLength(30)] public string? Unit { get; set; }
[StringLength(120)] public string? TypicalTravelTime { get; set; }
[StringLength(1000)] public string? Notes { get; set; }
}
public sealed class MapDocument
{
public StoryMap Map { get; set; } = new();
public List<MapFeature> Features { get; set; } = [];
public List<MapRelationship> Relationships { get; set; } = [];
}
public sealed class MapsViewModel
{
public Project Project { get; set; } = new();
public IReadOnlyList<StoryMap> Maps { get; set; } = [];
public IReadOnlyList<LocationItem> Locations { get; set; } = [];
public IReadOnlyList<FloorPlan> FloorPlans { get; set; } = [];
public IReadOnlyList<MapReferenceImage> ReferenceImages { get; set; } = [];
public MapDocument? Document { get; set; }
}