using DbController; using Tabletop.Core.Interfaces; using Tabletop.Core.Models.Abstract; namespace Tabletop.Core.Models { public class Weapon : LocalizationModelBase, IDbModel { [CompareField("weapon_id")] public int WeaponId { get; set; } [CompareField("attack")] public int Attack { get; set; } [CompareField("quality")] public int Quality { get; set; } [CompareField("range")] public int Range { get; set; } [CompareField("dices")] public int Dices { get; set; } public int? GetIdentifier() { return WeaponId > 0 ? WeaponId : null; } public IEnumerable> GetLocalizedParameters() { foreach (var description in Description) { yield return new Dictionary { { "PERMISSION_ID", WeaponId }, { "NAME", description.Name }, { "DESCRIPTION", description.Description } }; } } public Dictionary GetParameters() { return new Dictionary { { "WEAPON_ID", WeaponId }, { "ATTACK", Attack }, { "QUALITY", Quality }, { "RANGE", Range }, { "DICES", Dices } }; } } public class WeaponDescription : ILocalizationHelper { [CompareField("weapon_id")] public int WeaponId { get; set; } [CompareField("code")] public string Code { get; set; } = string.Empty; [CompareField("name")] public string Name { get; set; } = string.Empty; [CompareField("description")] public string Description { get; set; } = string.Empty; } }