Add project data

This commit is contained in:
2025-12-30 02:22:44 +01:00
parent a6316b8b06
commit 747af63a29
2301 changed files with 67690 additions and 1 deletions

View File

@@ -0,0 +1,64 @@
using DbController;
using Tabletop.Core.Interfaces;
using Tabletop.Core.Models.Abstract;
namespace Tabletop.Core.Models
{
public class Layout : LocalizationModelBase<LayoutDescription>, IDbModel<int?>
{
[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<SetupZone> SetupZones { get; set; } = [];
public List<CaptureZone> CaptureZones { get; set; } = [];
public int? GetIdentifier()
{
return LayoutId > 0 ? LayoutId : null;
}
public IEnumerable<Dictionary<string, object?>> GetLocalizedParameters()
{
foreach (var description in Description)
{
yield return new Dictionary<string, object?>
{
{ "LAYOUT_ID", LayoutId },
{ "NAME", description.Name }
};
}
}
public Dictionary<string, object?> GetParameters()
{
return new Dictionary<string, object?>
{
{ "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;
}
}