using DbController; using Tabletop.Core.Interfaces; using Tabletop.Core.Models.Abstract; namespace Tabletop.Core.Models { public class Layout : LocalizationModelBase, IDbModel { [CompareField("layout_id")] public int LayoutId { get; set; } [CompareField("gamemode_id")] public int GamemodeId { get; set; } [CompareField("teams")] public int Teams { get; set; } [CompareField("width")] public string Width { get; set; } = string.Empty; [CompareField("height")] public string Height { get; set; } = string.Empty; public List SetupZones { get; set; } = []; public List CaptureZones { get; set; } = []; public int? GetIdentifier() { return LayoutId > 0 ? LayoutId : null; } public IEnumerable> GetLocalizedParameters() { foreach (var description in Description) { yield return new Dictionary { { "LAYOUT_ID", LayoutId }, { "NAME", description.Name } }; } } public Dictionary GetParameters() { return new Dictionary { { "LAYOUT_ID", LayoutId }, { "GAMEMODE_ID", GamemodeId }, { "TEAMS", Teams }, { "WIDTH", Width }, { "HEIGHT", Height } }; } } public class LayoutDescription : ILocalizationHelper { [CompareField("layout_id")] public int LayoutId { get; set; } [CompareField("code")] public string Code { get; set; } = string.Empty; [CompareField("name")] public string Name { get; set; } = string.Empty; } }