diff --git a/SessionCompanion/SessionCompanion.Database/ApplicationDbContext.cs b/SessionCompanion/SessionCompanion.Database/ApplicationDbContext.cs index 83ac5eb..11bf6e7 100644 --- a/SessionCompanion/SessionCompanion.Database/ApplicationDbContext.cs +++ b/SessionCompanion/SessionCompanion.Database/ApplicationDbContext.cs @@ -24,6 +24,12 @@ namespace SessionCompanion.Database public virtual DbSet Strengths { get; set; } public virtual DbSet Users { get; set; } public virtual DbSet Wisdoms { get; set; } + public virtual DbSet Armors { get; set; } + public virtual DbSet CharacterArmors { get; set; } + public virtual DbSet Weapons { get; set; } + public virtual DbSet CharacterWeapons { get; set; } + public virtual DbSet OtherEquipment { get; set; } + public virtual DbSet CharacterOtherEquipment { get; set; } public ApplicationDbContext(DbContextOptions options) : base(options) { } diff --git a/SessionCompanion/SessionCompanion.Database/Repositories/ArmorRepository.cs b/SessionCompanion/SessionCompanion.Database/Repositories/ArmorRepository.cs new file mode 100644 index 0000000..a4b187f --- /dev/null +++ b/SessionCompanion/SessionCompanion.Database/Repositories/ArmorRepository.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Database.Repositories +{ + using SessionCompanion.Database.Repositories.Base; + using SessionCompanion.Database.Tables; + + public class ArmorRepository : Repository, IRepository + { + public ArmorRepository(ApplicationDbContext _dbContext) : base(_dbContext) + { } + } +} diff --git a/SessionCompanion/SessionCompanion.Database/Repositories/CharacterArmorRepository.cs b/SessionCompanion/SessionCompanion.Database/Repositories/CharacterArmorRepository.cs new file mode 100644 index 0000000..e76b7d9 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Database/Repositories/CharacterArmorRepository.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Database.Repositories +{ + using SessionCompanion.Database.Repositories.Base; + using SessionCompanion.Database.Tables; + + public class CharacterArmorRepository : Repository, IRepository + { + public CharacterArmorRepository(ApplicationDbContext _dbContext) : base(_dbContext) + { } + } +} diff --git a/SessionCompanion/SessionCompanion.Database/Repositories/CharacterOtherEquipmentRepository.cs b/SessionCompanion/SessionCompanion.Database/Repositories/CharacterOtherEquipmentRepository.cs new file mode 100644 index 0000000..72b9546 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Database/Repositories/CharacterOtherEquipmentRepository.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Database.Repositories +{ + using SessionCompanion.Database.Repositories.Base; + using SessionCompanion.Database.Tables; + + public class CharacterOtherEquipmentRepository : Repository, IRepository + { + public CharacterOtherEquipmentRepository(ApplicationDbContext _dbContext) : base(_dbContext) + { } + } +} diff --git a/SessionCompanion/SessionCompanion.Database/Repositories/CharacterWeaponRepository.cs b/SessionCompanion/SessionCompanion.Database/Repositories/CharacterWeaponRepository.cs new file mode 100644 index 0000000..a5afaf2 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Database/Repositories/CharacterWeaponRepository.cs @@ -0,0 +1,14 @@ +using SessionCompanion.Database.Repositories.Base; +using SessionCompanion.Database.Tables; +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Database.Repositories +{ + public class CharacterWeaponRepository: Repository, IRepository + { + public CharacterWeaponRepository(ApplicationDbContext _dbContext) : base(_dbContext) + { } + } +} diff --git a/SessionCompanion/SessionCompanion.Database/Repositories/OtherEquipmentRepository.cs b/SessionCompanion/SessionCompanion.Database/Repositories/OtherEquipmentRepository.cs new file mode 100644 index 0000000..1da5898 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Database/Repositories/OtherEquipmentRepository.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Database.Repositories +{ + using SessionCompanion.Database.Repositories.Base; + using SessionCompanion.Database.Tables; + + public class OtherEquipmentRepository : Repository, IRepository + { + public OtherEquipmentRepository(ApplicationDbContext _dbContext) : base(_dbContext) + { } + } +} diff --git a/SessionCompanion/SessionCompanion.Database/Repositories/WeaponRepository.cs b/SessionCompanion/SessionCompanion.Database/Repositories/WeaponRepository.cs new file mode 100644 index 0000000..6bd763d --- /dev/null +++ b/SessionCompanion/SessionCompanion.Database/Repositories/WeaponRepository.cs @@ -0,0 +1,14 @@ +using SessionCompanion.Database.Repositories.Base; +using SessionCompanion.Database.Tables; +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Database.Repositories +{ + public class WeaponRepository : Repository, IRepository + { + public WeaponRepository(ApplicationDbContext _dbContext) : base(_dbContext) + { } + } +} diff --git a/SessionCompanion/SessionCompanion.Database/SessionCompanion.Database.csproj b/SessionCompanion/SessionCompanion.Database/SessionCompanion.Database.csproj index e084383..a157829 100644 --- a/SessionCompanion/SessionCompanion.Database/SessionCompanion.Database.csproj +++ b/SessionCompanion/SessionCompanion.Database/SessionCompanion.Database.csproj @@ -17,4 +17,8 @@ + + + + diff --git a/SessionCompanion/SessionCompanion.Database/Tables/Armor.cs b/SessionCompanion/SessionCompanion.Database/Tables/Armor.cs new file mode 100644 index 0000000..ff5bf64 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Database/Tables/Armor.cs @@ -0,0 +1,21 @@ +using SessionCompanion.ViewModels.Enums; +using System.Collections.Generic; + +namespace SessionCompanion.Database.Tables +{ + + public class Armor : BaseEntity + { + public string Name { get; set; } + public string Category { get; set; } + public string ArmorClassBase {get; set; } + public bool HaveDexterityBonus { get; set; } + public int? MinimumStrength { get; set; } + public bool HaveStealthDisadvantage { get; set; } + public int Weight { get; set; } + public int Cost { get; set; } + public CurrencyType CurrencyType { get; set; } + + public virtual ICollection CharacterArmors { get; set; } + } +} diff --git a/SessionCompanion/SessionCompanion.Database/Tables/CharacterArmor.cs b/SessionCompanion/SessionCompanion.Database/Tables/CharacterArmor.cs new file mode 100644 index 0000000..734c9c0 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Database/Tables/CharacterArmor.cs @@ -0,0 +1,18 @@ +namespace SessionCompanion.Database.Tables +{ + using System.ComponentModel.DataAnnotations.Schema; + + public class CharacterArmor : BaseEntity + { + [ForeignKey(nameof(Character))] + public int CharacterId { get; set; } + public virtual Character Character { get; set; } + + [ForeignKey(nameof(Armor))] + public int ArmorId { get; set; } + public virtual Armor Armor { get; set; } + + public bool InUse { get; set; } + + } +} diff --git a/SessionCompanion/SessionCompanion.Database/Tables/CharacterOtherEquipment.cs b/SessionCompanion/SessionCompanion.Database/Tables/CharacterOtherEquipment.cs new file mode 100644 index 0000000..04c9e21 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Database/Tables/CharacterOtherEquipment.cs @@ -0,0 +1,15 @@ +namespace SessionCompanion.Database.Tables +{ + using System.ComponentModel.DataAnnotations.Schema; + + public class CharacterOtherEquipment : BaseEntity + { + [ForeignKey(nameof(Character))] + public int CharacterId { get; set; } + public virtual Character Character { get; set; } + + [ForeignKey(nameof(OtherEquipment))] + public int OtherEquipmentId { get; set; } + public virtual OtherEquipment OtherEquipment { get; set; } + } +} diff --git a/SessionCompanion/SessionCompanion.Database/Tables/CharacterWeapon.cs b/SessionCompanion/SessionCompanion.Database/Tables/CharacterWeapon.cs new file mode 100644 index 0000000..93dec50 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Database/Tables/CharacterWeapon.cs @@ -0,0 +1,20 @@ +using System.ComponentModel.DataAnnotations.Schema; + +namespace SessionCompanion.Database.Tables +{ + public class CharacterWeapon : BaseEntity + { + [ForeignKey(nameof(Character))] + public int CharacterId { get; set; } + public virtual Character Character { get; set; } + + [ForeignKey(nameof(Weapon))] + public int WeaponId { get; set; } + public virtual Weapon Weapon { get; set; } + + public bool InUse { get; set; } + + public bool HoldInRightHand { get; set; } + public bool HoldInLeftHand { get; set; } + } +} diff --git a/SessionCompanion/SessionCompanion.Database/Tables/OtherEquipment.cs b/SessionCompanion/SessionCompanion.Database/Tables/OtherEquipment.cs new file mode 100644 index 0000000..c03fbd1 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Database/Tables/OtherEquipment.cs @@ -0,0 +1,16 @@ +using SessionCompanion.ViewModels.Enums; +using System.Collections.Generic; + +namespace SessionCompanion.Database.Tables +{ + + public class OtherEquipment : BaseEntity + { + public string Name { get; set; } + public string Description { get; set; } + public int Cost { get; set; } + public CurrencyType CurrencyType { get; set; } + + public virtual ICollection CharacterOtherEquipments { get; set; } + } +} diff --git a/SessionCompanion/SessionCompanion.Database/Tables/Weapon.cs b/SessionCompanion/SessionCompanion.Database/Tables/Weapon.cs new file mode 100644 index 0000000..9bc3d5f --- /dev/null +++ b/SessionCompanion/SessionCompanion.Database/Tables/Weapon.cs @@ -0,0 +1,29 @@ +using SessionCompanion.ViewModels.Enums; +using System.Collections.Generic; + +namespace SessionCompanion.Database.Tables +{ + public class Weapon : BaseEntity + { + public string Name { get; set; } + public int Cost { get; set; } + public int Weight { get; set; } + + public CurrencyType CurrencyType { get; set; } + public int DiceCount { get; set; } + public int DiceValue { get; set; } + public int? TwoHandDiceCount { get; set; } + public int? TwoHandDiceValue { get; set; } + public string TwoHandDamageType { get; set; } + + public string Description { get; set; } + + public string WeaponType { get; set; } + public int RangeMeele { get; set; } + public int? RangeThrowNormal { get; set; } + public int? RangeThrowLong { get; set; } + public int? RangeLong { get; set; } + + public virtual ICollection CharacterWeapons { get; set; } + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Intefraces/IArmorService.cs b/SessionCompanion/SessionCompanion.Services/Intefraces/IArmorService.cs new file mode 100644 index 0000000..4df8f73 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Intefraces/IArmorService.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Services.Interfaces +{ + using SessionCompanion.Database.Tables; + using SessionCompanion.Services.Base; + using SessionCompanion.ViewModels.ArmorViewModels; + + public interface IArmorService : IServiceBase + { + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Intefraces/ICharacterArmorService.cs b/SessionCompanion/SessionCompanion.Services/Intefraces/ICharacterArmorService.cs new file mode 100644 index 0000000..08f0382 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Intefraces/ICharacterArmorService.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Services.Interfaces +{ + using System.Threading.Tasks; + + using SessionCompanion.Database.Tables; + using SessionCompanion.Services.Base; + using SessionCompanion.ViewModels.CharacterArmorViewModels; + + public interface ICharacterArmorService : IServiceBase + { + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Intefraces/ICharacterOtherEquipmentService.cs b/SessionCompanion/SessionCompanion.Services/Intefraces/ICharacterOtherEquipmentService.cs new file mode 100644 index 0000000..ec20aca --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Intefraces/ICharacterOtherEquipmentService.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Services.Interfaces +{ + using System.Threading.Tasks; + + using SessionCompanion.Database.Tables; + using SessionCompanion.Services.Base; + using SessionCompanion.ViewModels.CharacterOtherEquipmentViewModels; + + public interface ICharacterOtherEquipmentService : IServiceBase + { + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Intefraces/ICharacterWeaponService.cs b/SessionCompanion/SessionCompanion.Services/Intefraces/ICharacterWeaponService.cs new file mode 100644 index 0000000..3ac386e --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Intefraces/ICharacterWeaponService.cs @@ -0,0 +1,10 @@ +using SessionCompanion.Database.Tables; +using SessionCompanion.Services.Base; +using SessionCompanion.ViewModels.CharacterWeaponViewModels; + +namespace SessionCompanion.Services.Interfaces +{ + public interface ICharacterWeaponService : IServiceBase + { + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Intefraces/IOtherEquipmentService.cs b/SessionCompanion/SessionCompanion.Services/Intefraces/IOtherEquipmentService.cs new file mode 100644 index 0000000..0f13254 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Intefraces/IOtherEquipmentService.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Services.Interfaces +{ + using SessionCompanion.Database.Tables; + using SessionCompanion.Services.Base; + using SessionCompanion.ViewModels.OtherEquipmentViewModels; + + public interface IOtherEquipmentService : IServiceBase + { + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Intefraces/IWeaponService.cs b/SessionCompanion/SessionCompanion.Services/Intefraces/IWeaponService.cs new file mode 100644 index 0000000..0c56409 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Intefraces/IWeaponService.cs @@ -0,0 +1,13 @@ +using SessionCompanion.Database.Tables; +using SessionCompanion.Services.Base; +using SessionCompanion.ViewModels.WeaponViewModels; +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Services.Interfaces +{ + public interface IWeaponService : IServiceBase + { + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Profiles/ArmorProfile.cs b/SessionCompanion/SessionCompanion.Services/Profiles/ArmorProfile.cs new file mode 100644 index 0000000..598fb79 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Profiles/ArmorProfile.cs @@ -0,0 +1,14 @@ +using AutoMapper; +using SessionCompanion.Database.Tables; +using SessionCompanion.ViewModels.ArmorViewModels; + +namespace SessionCompanion.Services.Profiles +{ + public class ArmorProfile : Profile + { + public ArmorProfile() + { + CreateMap().ReverseMap(); + } + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Profiles/CharacterArmorsProfile.cs b/SessionCompanion/SessionCompanion.Services/Profiles/CharacterArmorsProfile.cs new file mode 100644 index 0000000..a3ba8f0 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Profiles/CharacterArmorsProfile.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Services.Profiles +{ + using AutoMapper; + + using SessionCompanion.Database.Tables; + using SessionCompanion.ViewModels.CharacterArmorViewModels; + + public class CharacterArmorsProfile : Profile + { + public CharacterArmorsProfile() + { + CreateMap().ReverseMap(); + + CreateMap() + .ForMember(vm => vm.Name, conf => conf.MapFrom(armor => armor.Armor.Name.ToString())) + .ForMember(vm => vm.Category, conf => conf.MapFrom(armor => armor.Armor.Category.ToString())) + .ForMember( + vm => vm.ArmorClassBase, + conf => conf.MapFrom(armor => armor.Armor.ArmorClassBase.ToString())) + .ForMember(vm => vm.HaveDexterityBonus, conf => conf.MapFrom(armor => armor.Armor.HaveDexterityBonus)) + .ForMember(vm => vm.MinimumStrength, conf => conf.MapFrom(armor => armor.Armor.MinimumStrength)) + .ForMember( + vm => vm.HaveStealthDisadvantage, + conf => conf.MapFrom(armor => armor.Armor.HaveStealthDisadvantage)) + .ForMember(vm => vm.Weight, conf => conf.MapFrom(armor => armor.Armor.Weight)) + .ForMember(vm => vm.Cost, conf => conf.MapFrom(armor => armor.Armor.Cost)) + .ForMember(vm => vm.CurrencyType, conf => conf.MapFrom(armor => armor.Armor.CurrencyType)).ReverseMap(); + } + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Profiles/CharacterOtherEquipmentsProfile.cs b/SessionCompanion/SessionCompanion.Services/Profiles/CharacterOtherEquipmentsProfile.cs new file mode 100644 index 0000000..cafff93 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Profiles/CharacterOtherEquipmentsProfile.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Services.Profiles +{ + using AutoMapper; + + using SessionCompanion.Database.Tables; + using SessionCompanion.ViewModels.CharacterOtherEquipmentViewModels; + + public class CharacterOtherEquipmentsProfile : Profile + { + public CharacterOtherEquipmentsProfile() + { + CreateMap().ReverseMap(); + + CreateMap() + .ForMember(vm => vm.Name, conf => conf.MapFrom(otherEquipment => otherEquipment.OtherEquipment.Name.ToString())) + .ForMember( + vm => vm.Description, + conf => conf.MapFrom(otherEquipment => otherEquipment.OtherEquipment.Description.ToString())) + .ForMember( + vm => vm.Cost, + conf => conf.MapFrom(otherEquipment => otherEquipment.OtherEquipment.Cost)) + .ForMember( + vm => vm.CurrencyType, + conf => conf.MapFrom(otherEquipment => otherEquipment.OtherEquipment.CurrencyType)).ReverseMap(); + } + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Profiles/CharacterWeaponsProfile.cs b/SessionCompanion/SessionCompanion.Services/Profiles/CharacterWeaponsProfile.cs new file mode 100644 index 0000000..825c0aa --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Profiles/CharacterWeaponsProfile.cs @@ -0,0 +1,32 @@ +using AutoMapper; +using SessionCompanion.Database.Tables; +using SessionCompanion.ViewModels.CharacterWeaponViewModels; + +namespace SessionCompanion.Services.Profiles +{ + public class CharacterWeaponsProfile : Profile + { + public CharacterWeaponsProfile() + { + CreateMap().ReverseMap(); + + CreateMap() + .ForMember(vm => vm.Name, conf => conf.MapFrom(weapon => weapon.Weapon.Name.ToString())) + .ForMember(vm => vm.Weight, conf => conf.MapFrom(weapon => weapon.Weapon.Weight.ToString())) + .ForMember(vm => vm.HoldInRightHand, conf => conf.MapFrom(weapon => weapon.HoldInRightHand)) + .ForMember(vm => vm.HoldInLeftHand, conf => conf.MapFrom(weapon => weapon.HoldInLeftHand)) + .ForMember(vm => vm.Cost, conf => conf.MapFrom(weapon => weapon.Weapon.Cost.ToString())) + .ForMember(vm => vm.RangeMeele, conf => conf.MapFrom(weapon => weapon.Weapon.RangeMeele)) + .ForMember(vm => vm.RangeLong, conf => conf.MapFrom(weapon => weapon.Weapon.RangeLong)) + .ForMember(vm => vm.RangeThrowNormal, conf => conf.MapFrom(weapon => weapon.Weapon.RangeThrowNormal)) + .ForMember(vm => vm.RangeThrowLong, conf => conf.MapFrom(weapon => weapon.Weapon.RangeThrowLong)) + .ForMember(vm => vm.CurrencyType, conf => conf.MapFrom(weapon => weapon.Weapon.CurrencyType.ToString())) + .ForMember(vm => vm.WeaponType, conf => conf.MapFrom(weapon => weapon.Weapon.WeaponType.ToString())) + .ForMember(vm => vm.Description, conf => conf.MapFrom(weapon => weapon.Weapon.Description)) + .ForMember(vm => vm.DiceValue, conf => conf.MapFrom(weapon => weapon.Weapon.DiceValue)) + .ForMember(vm => vm.DiceCount, conf => conf.MapFrom(weapon => weapon.Weapon.DiceCount)) + .ForMember(vm => vm.TwoHandDiceValue, conf => conf.MapFrom(weapon => weapon.Weapon.TwoHandDiceValue)) + .ForMember(vm => vm.TwoHandDamageType, conf => conf.MapFrom(weapon => weapon.Weapon.TwoHandDamageType.ToString())).ReverseMap(); + } + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Profiles/OtherEquipmentProfile.cs b/SessionCompanion/SessionCompanion.Services/Profiles/OtherEquipmentProfile.cs new file mode 100644 index 0000000..529e6ea --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Profiles/OtherEquipmentProfile.cs @@ -0,0 +1,14 @@ +using AutoMapper; +using SessionCompanion.Database.Tables; +using SessionCompanion.ViewModels.OtherEquipmentViewModels; + +namespace SessionCompanion.Services.Profiles +{ + public class OtherEquipmentProfile : Profile + { + public OtherEquipmentProfile() + { + CreateMap().ReverseMap(); + } + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Profiles/WeaponProfile.cs b/SessionCompanion/SessionCompanion.Services/Profiles/WeaponProfile.cs new file mode 100644 index 0000000..a0a6c69 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Profiles/WeaponProfile.cs @@ -0,0 +1,14 @@ +using AutoMapper; +using SessionCompanion.Database.Tables; +using SessionCompanion.ViewModels.WeaponViewModels; + +namespace SessionCompanion.Services.Profiles +{ + public class WeaponProfile : Profile + { + public WeaponProfile() + { + CreateMap().ReverseMap(); + } + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Services/ArmorService.cs b/SessionCompanion/SessionCompanion.Services/Services/ArmorService.cs new file mode 100644 index 0000000..9397f8c --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Services/ArmorService.cs @@ -0,0 +1,16 @@ +namespace SessionCompanion.Services.Services +{ + using AutoMapper; + + using SessionCompanion.Database.Repositories.Base; + using SessionCompanion.Database.Tables; + using SessionCompanion.Services.Base; + using SessionCompanion.Services.Interfaces; + using SessionCompanion.ViewModels.ArmorViewModels; + + public class ArmorService : ServiceBase, IArmorService + { + public ArmorService(IMapper mapper, IRepository repository) : base(mapper, repository) + { } + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Services/CharacterArmorService.cs b/SessionCompanion/SessionCompanion.Services/Services/CharacterArmorService.cs new file mode 100644 index 0000000..8b417dd --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Services/CharacterArmorService.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Services.Services +{ + using System.Linq; + using System.Threading.Tasks; + + using AutoMapper; + + using Microsoft.EntityFrameworkCore; + + using SessionCompanion.Database.Repositories.Base; + using SessionCompanion.Database.Tables; + using SessionCompanion.Services.Base; + using SessionCompanion.Services.Interfaces; + using SessionCompanion.ViewModels.CharacterArmorViewModels; + + public class CharacterArmorService : ServiceBase, ICharacterArmorService + { + public CharacterArmorService(IMapper mapper, IRepository repository) : base(mapper, repository) + { } + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Services/CharacterOtherEquipmentService.cs b/SessionCompanion/SessionCompanion.Services/Services/CharacterOtherEquipmentService.cs new file mode 100644 index 0000000..1d80427 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Services/CharacterOtherEquipmentService.cs @@ -0,0 +1,17 @@ +namespace SessionCompanion.Services.Services +{ + + using AutoMapper; + using SessionCompanion.Database.Repositories.Base; + using SessionCompanion.Database.Tables; + using SessionCompanion.Services.Base; + using SessionCompanion.Services.Interfaces; + using SessionCompanion.ViewModels.CharacterOtherEquipmentViewModels; + + public class CharacterOtherEquipmentService : ServiceBase, ICharacterOtherEquipmentService + { + public CharacterOtherEquipmentService(IMapper mapper, IRepository repository) : base(mapper, repository) + { } + + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Services/CharacterWeaponService.cs b/SessionCompanion/SessionCompanion.Services/Services/CharacterWeaponService.cs new file mode 100644 index 0000000..3dae1ac --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Services/CharacterWeaponService.cs @@ -0,0 +1,15 @@ +using AutoMapper; +using SessionCompanion.Database.Repositories.Base; +using SessionCompanion.Database.Tables; +using SessionCompanion.Services.Base; +using SessionCompanion.Services.Interfaces; +using SessionCompanion.ViewModels.CharacterWeaponViewModels; + +namespace SessionCompanion.Services.Services +{ + public class CharacterWeaponService : ServiceBase, ICharacterWeaponService + { + public CharacterWeaponService(IMapper mapper, IRepository repository) : base(mapper, repository) + { } + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Services/OtherEquipmentService.cs b/SessionCompanion/SessionCompanion.Services/Services/OtherEquipmentService.cs new file mode 100644 index 0000000..c10e425 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Services/OtherEquipmentService.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Services.Services +{ + using AutoMapper; + + using SessionCompanion.Database.Repositories.Base; + using SessionCompanion.Database.Tables; + using SessionCompanion.Services.Base; + using SessionCompanion.Services.Interfaces; + using SessionCompanion.ViewModels.OtherEquipmentViewModels; + + public class OtherEquipmentService : ServiceBase, IOtherEquipmentService + { + public OtherEquipmentService(IMapper mapper, IRepository repository) : base(mapper, repository) + { } + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Services/WeaponService.cs b/SessionCompanion/SessionCompanion.Services/Services/WeaponService.cs new file mode 100644 index 0000000..a3a12f4 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Services/WeaponService.cs @@ -0,0 +1,18 @@ +using AutoMapper; +using SessionCompanion.Database.Repositories.Base; +using SessionCompanion.Database.Tables; +using SessionCompanion.Services.Base; +using SessionCompanion.Services.Interfaces; +using SessionCompanion.ViewModels.WeaponViewModels; +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Services.Services +{ + public class WeaponService : ServiceBase, IWeaponService + { + public WeaponService(IMapper mapper, IRepository repository) : base(mapper, repository) + { } + } +} diff --git a/SessionCompanion/SessionCompanion.ViewModels/ArmorViewModel/ArmorViewModel.cs b/SessionCompanion/SessionCompanion.ViewModels/ArmorViewModel/ArmorViewModel.cs new file mode 100644 index 0000000..892da7c --- /dev/null +++ b/SessionCompanion/SessionCompanion.ViewModels/ArmorViewModel/ArmorViewModel.cs @@ -0,0 +1,18 @@ +namespace SessionCompanion.ViewModels.ArmorViewModels +{ + using SessionCompanion.ViewModels.Enums; + + public class ArmorViewModel + { + public int Id { get; set; } + public string Name { get; set; } + public string Category { get; set; } + public string ArmorClassBase { get; set; } + public bool HaveDexterityBonus { get; set; } + public int? MinimumStrength { get; set; } + public bool HaveStealthDisadvantage { get; set; } + public int Weight { get; set; } + public int Cost { get; set; } + public CurrencyType CurrencyType { get; set; } + } +} diff --git a/SessionCompanion/SessionCompanion.ViewModels/CharacterArmorViewModels/CharacterArmorViewModel.cs b/SessionCompanion/SessionCompanion.ViewModels/CharacterArmorViewModels/CharacterArmorViewModel.cs new file mode 100644 index 0000000..a8098de --- /dev/null +++ b/SessionCompanion/SessionCompanion.ViewModels/CharacterArmorViewModels/CharacterArmorViewModel.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.ViewModels.CharacterArmorViewModels +{ + public class CharacterArmorViewModel + { + public int Id { get; set; } + public int CharacterId { get; set; } + public int ArmorId { get; set; } + public bool InUse { get; set; } + } +} diff --git a/SessionCompanion/SessionCompanion.ViewModels/CharacterArmorViewModels/CharacterArmorViewModelDetails.cs b/SessionCompanion/SessionCompanion.ViewModels/CharacterArmorViewModels/CharacterArmorViewModelDetails.cs new file mode 100644 index 0000000..57bb3fc --- /dev/null +++ b/SessionCompanion/SessionCompanion.ViewModels/CharacterArmorViewModels/CharacterArmorViewModelDetails.cs @@ -0,0 +1,21 @@ +using SessionCompanion.ViewModels.Enums; + +namespace SessionCompanion.ViewModels.CharacterArmorViewModels +{ + public class CharacterArmorViewModelDetails + { + public int Id { get; set; } + public int CharacterId { get; set; } + public int ArmorId { get; set; } + public string Name { get; set; } + public string Category { get; set; } + public string ArmorClassBase { get; set; } + public bool HaveDexterityBonus { get; set; } + public int? MinimumStrength { get; set; } + public bool HaveStealthDisadvantage { get; set; } + public int Weight { get; set; } + public int Cost { get; set; } + public CurrencyType CurrencyType { get; set; } + public bool InUse { get; set; } + } +} diff --git a/SessionCompanion/SessionCompanion.ViewModels/CharacterOtherEquipmentViewModels/CharacterOtherEquipmentViewModel.cs b/SessionCompanion/SessionCompanion.ViewModels/CharacterOtherEquipmentViewModels/CharacterOtherEquipmentViewModel.cs new file mode 100644 index 0000000..7317779 --- /dev/null +++ b/SessionCompanion/SessionCompanion.ViewModels/CharacterOtherEquipmentViewModels/CharacterOtherEquipmentViewModel.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.ViewModels.CharacterOtherEquipmentViewModels +{ + public class CharacterOtherEquipmentViewModel + { + public int Id { get; set; } + public int CharacterId { get; set; } + public int OtherEquipmentId { get; set; } + } +} diff --git a/SessionCompanion/SessionCompanion.ViewModels/CharacterOtherEquipmentViewModels/CharacterOtherEquipmentWithDetailsViewModel.cs b/SessionCompanion/SessionCompanion.ViewModels/CharacterOtherEquipmentViewModels/CharacterOtherEquipmentWithDetailsViewModel.cs new file mode 100644 index 0000000..9e08e80 --- /dev/null +++ b/SessionCompanion/SessionCompanion.ViewModels/CharacterOtherEquipmentViewModels/CharacterOtherEquipmentWithDetailsViewModel.cs @@ -0,0 +1,15 @@ +using SessionCompanion.ViewModels.Enums; + +namespace SessionCompanion.ViewModels.CharacterOtherEquipmentViewModels +{ + public class CharacterOtherEquipmentWithDetailsViewModel + { + public int Id { get; set; } + public int CharacterId { get; set; } + public int OtherEquipmentId { get; set; } + public string Name { get; set; } + public string Description { get; set; } + public int Cost { get; set; } + public CurrencyType CurrencyType { get; set; } + } +} diff --git a/SessionCompanion/SessionCompanion.ViewModels/CharacterWeaponsViewModels/CharacterWeaponViewModel.cs b/SessionCompanion/SessionCompanion.ViewModels/CharacterWeaponsViewModels/CharacterWeaponViewModel.cs new file mode 100644 index 0000000..50fd0d7 --- /dev/null +++ b/SessionCompanion/SessionCompanion.ViewModels/CharacterWeaponsViewModels/CharacterWeaponViewModel.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Text; + +namespace SessionCompanion.ViewModels.CharacterWeaponViewModels +{ + public class CharacterWeaponViewModel + { + public int Id { get; set; } + public int CharacterId { get; set; } + public int WeaponId { get; set; } + public bool InUse { get; set; } + public bool HoldInRightHand { get; set; } + public bool HoldInLeftHand { get; set; } + } +} diff --git a/SessionCompanion/SessionCompanion.ViewModels/CharacterWeaponsViewModels/CharacterWeaponWithWeaponsDetailsViewModel.cs b/SessionCompanion/SessionCompanion.ViewModels/CharacterWeaponsViewModels/CharacterWeaponWithWeaponsDetailsViewModel.cs new file mode 100644 index 0000000..2e42d82 --- /dev/null +++ b/SessionCompanion/SessionCompanion.ViewModels/CharacterWeaponsViewModels/CharacterWeaponWithWeaponsDetailsViewModel.cs @@ -0,0 +1,28 @@ +using SessionCompanion.ViewModels.Enums; +using System.Collections.Generic; + +namespace SessionCompanion.ViewModels.CharacterWeaponViewModels +{ + public class CharacterWeaponWithWeaponDetailsViewModel + { + public int WeaponId { get; set; } + public bool InUse { get; set; } + public string Name { get; set; } + public int Cost { get; set; } + public CurrencyType CurrencyType { get; set; } + public int Weight { get; set; } + public bool HoldInRightHand { get; set; } + public bool HoldInLeftHand { get; set; } + public int DiceCount { get; set; } + public int DiceValue { get; set; } + public int? TwoHandDiceCount { get; set; } + public int? TwoHandDiceValue { get; set; } + public string TwoHandDamageType { get; set; } + public string Description { get; set; } + public string WeaponType { get; set; } + public int RangeMeele { get; set; } + public int? RangeThrowNormal { get; set; } + public int? RangeThrowLong { get; set; } + public int? RangeLong { get; set; } + } +} diff --git a/SessionCompanion/SessionCompanion.ViewModels/Enums/CurrencyType.cs b/SessionCompanion/SessionCompanion.ViewModels/Enums/CurrencyType.cs new file mode 100644 index 0000000..3777e97 --- /dev/null +++ b/SessionCompanion/SessionCompanion.ViewModels/Enums/CurrencyType.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SessionCompanion.ViewModels.Enums +{ + + /// + /// Rodzaje waluty + /// + public enum CurrencyType + { + /// + /// Bronz + /// + cp, + + /// + /// Srebro + /// + sp, + + /// + /// Elektrum + /// + ep, + + /// + /// Złotot + /// + gp, + + /// + /// Platyna + /// + pp + } +} diff --git a/SessionCompanion/SessionCompanion.ViewModels/OtherEquipmentViewModels/OtherEquipmentViewModel.cs b/SessionCompanion/SessionCompanion.ViewModels/OtherEquipmentViewModels/OtherEquipmentViewModel.cs new file mode 100644 index 0000000..3774892 --- /dev/null +++ b/SessionCompanion/SessionCompanion.ViewModels/OtherEquipmentViewModels/OtherEquipmentViewModel.cs @@ -0,0 +1,13 @@ +namespace SessionCompanion.ViewModels.OtherEquipmentViewModels +{ + using SessionCompanion.ViewModels.Enums; + + public class OtherEquipmentViewModel + { + public int Id { get; set; } + public string Name { get; set; } + public string Description { get; set; } + public int Cost { get; set; } + public CurrencyType CurrencyType { get; set; } + } +} diff --git a/SessionCompanion/SessionCompanion.ViewModels/SessionCompanion.ViewModels.xml b/SessionCompanion/SessionCompanion.ViewModels/SessionCompanion.ViewModels.xml index 71e048b..0f4d1b1 100644 --- a/SessionCompanion/SessionCompanion.ViewModels/SessionCompanion.ViewModels.xml +++ b/SessionCompanion/SessionCompanion.ViewModels/SessionCompanion.ViewModels.xml @@ -305,6 +305,36 @@ Czy postać posiada biegłość w skradaniu się + + + Rodzaje waluty + + + + + Bronz + + + + + Srebro + + + + + Elektrum + + + + + Złotot + + + + + Platyna + + Identyfikator inteligencji postaci diff --git a/SessionCompanion/SessionCompanion.ViewModels/WeaponViewModels/WeaponViewModel.cs b/SessionCompanion/SessionCompanion.ViewModels/WeaponViewModels/WeaponViewModel.cs new file mode 100644 index 0000000..4281d7e --- /dev/null +++ b/SessionCompanion/SessionCompanion.ViewModels/WeaponViewModels/WeaponViewModel.cs @@ -0,0 +1,29 @@ +using SessionCompanion.ViewModels.Enums; +using System.Collections.Generic; + +namespace SessionCompanion.ViewModels.WeaponViewModels +{ + public class WeaponViewModel + { + public int Id { get; set; } + public string Name { get; set; } + public int Cost { get; set; } + public int Weight { get; set; } + + public CurrencyType CurrencyType { get; set; } + public int DiceCount { get; set; } + public int DiceValue { get; set; } + + public int? TwoHandDiceCount { get; set; } + public int? TwoHandDiceValue { get; set; } + public string TwoHandDamageType { get; set; } + + public string Description { get; set; } + + public string WeaponType { get; set; } + public int RangeMeele { get; set; } + public int? RangeThrowNormal { get; set; } + public int? RangeThrowLong { get; set; } + public int? RangeLong { get; set; } + } +} diff --git a/SessionCompanion/SessionCompanion/Configurations/RepositoryConfiguration.cs b/SessionCompanion/SessionCompanion/Configurations/RepositoryConfiguration.cs index 888dce3..fdbcfd1 100644 --- a/SessionCompanion/SessionCompanion/Configurations/RepositoryConfiguration.cs +++ b/SessionCompanion/SessionCompanion/Configurations/RepositoryConfiguration.cs @@ -27,6 +27,12 @@ namespace SessionCompanion.Configurations services.AddScoped, StrengthRepository>(); services.AddScoped, UserRepository>(); services.AddScoped, WisdomRepository>(); + services.AddScoped, ArmorRepository>(); + services.AddScoped, CharacterArmorRepository>(); + services.AddScoped, OtherEquipmentRepository>(); + services.AddScoped, CharacterOtherEquipmentRepository>(); + services.AddScoped, WeaponRepository>(); + services.AddScoped, CharacterWeaponRepository>(); return services; } diff --git a/SessionCompanion/SessionCompanion/Configurations/ServiceConfiguration.cs b/SessionCompanion/SessionCompanion/Configurations/ServiceConfiguration.cs index 0d29b5d..c243a8f 100644 --- a/SessionCompanion/SessionCompanion/Configurations/ServiceConfiguration.cs +++ b/SessionCompanion/SessionCompanion/Configurations/ServiceConfiguration.cs @@ -26,6 +26,13 @@ namespace SessionCompanion.Configurations services.AddScoped(); services.AddScoped(); services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + return services; } }