merge
This commit is contained in:
commit
03366a3540
@ -24,6 +24,12 @@ namespace SessionCompanion.Database
|
||||
public virtual DbSet<Strength> Strengths { get; set; }
|
||||
public virtual DbSet<User> Users { get; set; }
|
||||
public virtual DbSet<Wisdom> Wisdoms { get; set; }
|
||||
public virtual DbSet<Armor> Armors { get; set; }
|
||||
public virtual DbSet<CharacterArmor> CharacterArmors { get; set; }
|
||||
public virtual DbSet<Weapon> Weapons { get; set; }
|
||||
public virtual DbSet<CharacterWeapon> CharacterWeapons { get; set; }
|
||||
public virtual DbSet<OtherEquipment> OtherEquipment { get; set; }
|
||||
public virtual DbSet<CharacterOtherEquipment> CharacterOtherEquipment { get; set; }
|
||||
|
||||
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) : base(options) { }
|
||||
|
||||
|
@ -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<Armor>, IRepository<Armor>
|
||||
{
|
||||
public ArmorRepository(ApplicationDbContext _dbContext) : base(_dbContext)
|
||||
{ }
|
||||
}
|
||||
}
|
@ -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<CharacterArmor>, IRepository<CharacterArmor>
|
||||
{
|
||||
public CharacterArmorRepository(ApplicationDbContext _dbContext) : base(_dbContext)
|
||||
{ }
|
||||
}
|
||||
}
|
@ -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<CharacterOtherEquipment>, IRepository<CharacterOtherEquipment>
|
||||
{
|
||||
public CharacterOtherEquipmentRepository(ApplicationDbContext _dbContext) : base(_dbContext)
|
||||
{ }
|
||||
}
|
||||
}
|
@ -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<CharacterWeapon>, IRepository<CharacterWeapon>
|
||||
{
|
||||
public CharacterWeaponRepository(ApplicationDbContext _dbContext) : base(_dbContext)
|
||||
{ }
|
||||
}
|
||||
}
|
@ -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<OtherEquipment>, IRepository<OtherEquipment>
|
||||
{
|
||||
public OtherEquipmentRepository(ApplicationDbContext _dbContext) : base(_dbContext)
|
||||
{ }
|
||||
}
|
||||
}
|
@ -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<Weapon>, IRepository<Weapon>
|
||||
{
|
||||
public WeaponRepository(ApplicationDbContext _dbContext) : base(_dbContext)
|
||||
{ }
|
||||
}
|
||||
}
|
@ -17,4 +17,8 @@
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\SessionCompanion.ViewModels\SessionCompanion.ViewModels.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
21
SessionCompanion/SessionCompanion.Database/Tables/Armor.cs
Normal file
21
SessionCompanion/SessionCompanion.Database/Tables/Armor.cs
Normal file
@ -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<CharacterArmor> CharacterArmors { get; set; }
|
||||
}
|
||||
}
|
@ -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; }
|
||||
|
||||
}
|
||||
}
|
@ -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; }
|
||||
}
|
||||
}
|
@ -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; }
|
||||
}
|
||||
}
|
@ -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<CharacterOtherEquipment> CharacterOtherEquipments { get; set; }
|
||||
}
|
||||
}
|
29
SessionCompanion/SessionCompanion.Database/Tables/Weapon.cs
Normal file
29
SessionCompanion/SessionCompanion.Database/Tables/Weapon.cs
Normal file
@ -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<CharacterWeapon> CharacterWeapons { get; set; }
|
||||
}
|
||||
}
|
@ -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<ArmorViewModel, Armor>
|
||||
{
|
||||
}
|
||||
}
|
@ -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<CharacterArmorViewModel, CharacterArmor>
|
||||
{
|
||||
}
|
||||
}
|
@ -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<CharacterOtherEquipmentViewModel, CharacterOtherEquipment>
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
using SessionCompanion.Database.Tables;
|
||||
using SessionCompanion.Services.Base;
|
||||
using SessionCompanion.ViewModels.CharacterWeaponViewModels;
|
||||
|
||||
namespace SessionCompanion.Services.Interfaces
|
||||
{
|
||||
public interface ICharacterWeaponService : IServiceBase<CharacterWeaponViewModel, CharacterWeapon>
|
||||
{
|
||||
}
|
||||
}
|
@ -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<OtherEquipmentViewModel, OtherEquipment>
|
||||
{
|
||||
}
|
||||
}
|
@ -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<WeaponViewModel, Weapon>
|
||||
{
|
||||
}
|
||||
}
|
@ -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<Armor, ArmorViewModel>().ReverseMap();
|
||||
}
|
||||
}
|
||||
}
|
@ -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<CharacterArmorViewModel, CharacterArmor>().ReverseMap();
|
||||
|
||||
CreateMap<CharacterArmor, CharacterArmorViewModelDetails>()
|
||||
.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();
|
||||
}
|
||||
}
|
||||
}
|
@ -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<CharacterOtherEquipmentViewModel, CharacterOtherEquipment>().ReverseMap();
|
||||
|
||||
CreateMap<CharacterOtherEquipment, CharacterOtherEquipmentWithDetailsViewModel>()
|
||||
.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();
|
||||
}
|
||||
}
|
||||
}
|
@ -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<CharacterWeaponViewModel, CharacterWeapon>().ReverseMap();
|
||||
|
||||
CreateMap<CharacterWeapon, CharacterWeaponWithWeaponDetailsViewModel>()
|
||||
.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();
|
||||
}
|
||||
}
|
||||
}
|
@ -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<OtherEquipmentViewModel, OtherEquipment>().ReverseMap();
|
||||
}
|
||||
}
|
||||
}
|
@ -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<WeaponViewModel, Weapon>().ReverseMap();
|
||||
}
|
||||
}
|
||||
}
|
@ -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<ArmorViewModel, Armor>, IArmorService
|
||||
{
|
||||
public ArmorService(IMapper mapper, IRepository<Armor> repository) : base(mapper, repository)
|
||||
{ }
|
||||
}
|
||||
}
|
@ -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<CharacterArmorViewModel, CharacterArmor>, ICharacterArmorService
|
||||
{
|
||||
public CharacterArmorService(IMapper mapper, IRepository<CharacterArmor> repository) : base(mapper, repository)
|
||||
{ }
|
||||
}
|
||||
}
|
@ -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<CharacterOtherEquipmentViewModel, CharacterOtherEquipment>, ICharacterOtherEquipmentService
|
||||
{
|
||||
public CharacterOtherEquipmentService(IMapper mapper, IRepository<CharacterOtherEquipment> repository) : base(mapper, repository)
|
||||
{ }
|
||||
|
||||
}
|
||||
}
|
@ -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<CharacterWeaponViewModel, CharacterWeapon>, ICharacterWeaponService
|
||||
{
|
||||
public CharacterWeaponService(IMapper mapper, IRepository<CharacterWeapon> repository) : base(mapper, repository)
|
||||
{ }
|
||||
}
|
||||
}
|
@ -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<OtherEquipmentViewModel, OtherEquipment>, IOtherEquipmentService
|
||||
{
|
||||
public OtherEquipmentService(IMapper mapper, IRepository<OtherEquipment> repository) : base(mapper, repository)
|
||||
{ }
|
||||
}
|
||||
}
|
@ -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<WeaponViewModel, Weapon>, IWeaponService
|
||||
{
|
||||
public WeaponService(IMapper mapper, IRepository<Weapon> repository) : base(mapper, repository)
|
||||
{ }
|
||||
}
|
||||
}
|
@ -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; }
|
||||
}
|
||||
}
|
@ -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; }
|
||||
}
|
||||
}
|
@ -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; }
|
||||
}
|
||||
}
|
@ -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; }
|
||||
}
|
||||
}
|
@ -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; }
|
||||
}
|
||||
}
|
@ -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; }
|
||||
}
|
||||
}
|
@ -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; }
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SessionCompanion.ViewModels.Enums
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Rodzaje waluty
|
||||
/// </summary>
|
||||
public enum CurrencyType
|
||||
{
|
||||
/// <summary>
|
||||
/// Bronz
|
||||
/// </summary>
|
||||
cp,
|
||||
|
||||
/// <summary>
|
||||
/// Srebro
|
||||
/// </summary>
|
||||
sp,
|
||||
|
||||
/// <summary>
|
||||
/// Elektrum
|
||||
/// </summary>
|
||||
ep,
|
||||
|
||||
/// <summary>
|
||||
/// Złotot
|
||||
/// </summary>
|
||||
gp,
|
||||
|
||||
/// <summary>
|
||||
/// Platyna
|
||||
/// </summary>
|
||||
pp
|
||||
}
|
||||
}
|
@ -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; }
|
||||
}
|
||||
}
|
@ -310,6 +310,36 @@
|
||||
Czy postać posiada biegłość w skradaniu się
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:SessionCompanion.ViewModels.Enums.CurrencyType">
|
||||
<summary>
|
||||
Rodzaje waluty
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:SessionCompanion.ViewModels.Enums.CurrencyType.cp">
|
||||
<summary>
|
||||
Bronz
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:SessionCompanion.ViewModels.Enums.CurrencyType.sp">
|
||||
<summary>
|
||||
Srebro
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:SessionCompanion.ViewModels.Enums.CurrencyType.ep">
|
||||
<summary>
|
||||
Elektrum
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:SessionCompanion.ViewModels.Enums.CurrencyType.gp">
|
||||
<summary>
|
||||
Złotot
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:SessionCompanion.ViewModels.Enums.CurrencyType.pp">
|
||||
<summary>
|
||||
Platyna
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:SessionCompanion.ViewModels.IntelligenceViewModels.IntelligenceViewModel.Id">
|
||||
<summary>
|
||||
Identyfikator inteligencji postaci
|
||||
|
@ -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; }
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
@import "../../../styles.css";
|
||||
|
||||
.menu-spacer {
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
|
||||
.root-container {
|
||||
height: calc(100vh - 64px);
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.root-container {
|
||||
height: calc(100vh - 58px);
|
||||
}
|
||||
}
|
||||
|
||||
.sidenav-container {
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
}
|
||||
.content {
|
||||
background-color: #102028;
|
||||
color: #df7c0f;
|
||||
}
|
||||
|
||||
.navbar {
|
||||
background-color: #df7c0f;
|
||||
color: #e9cca7;
|
||||
}
|
||||
|
||||
.sidenav {
|
||||
background-color: #102028;
|
||||
}
|
||||
|
||||
.mat-list-item.active{
|
||||
color: #e9cca7;
|
||||
}
|
@ -1 +1,57 @@
|
||||
<div class="root-container">
|
||||
<mat-toolbar>
|
||||
<mat-toolbar-row class="navbar">
|
||||
<button mat-icon-button (click)="sidenav.toggle()" fxShow="true" fxHide.gt-sm>
|
||||
<mat-icon>menu</mat-icon>
|
||||
</button>
|
||||
<span class="menu-spacer"></span>
|
||||
<div fxShow="true" fxHide.lt-md>
|
||||
<span>Session Companion</span>
|
||||
</div>
|
||||
</mat-toolbar-row>
|
||||
</mat-toolbar>
|
||||
|
||||
<mat-sidenav-container class="sidenav-container">
|
||||
<mat-sidenav #sidenav class="sidenav">
|
||||
<mat-nav-list>
|
||||
|
||||
<mat-list-item [routerLink]="['/player']" [routerLinkActive]="['active']">
|
||||
<mat-icon [class.active]="selected" matListIcon>home</mat-icon>
|
||||
<a matLine>Home</a>
|
||||
</mat-list-item>
|
||||
|
||||
<mat-list-item [routerLink]="['/player/statistic']" [routerLinkActive]="['active']">
|
||||
<mat-icon [class.active]="selected" matListIcon>query_stats</mat-icon>
|
||||
<a matLine>Statistic and throws</a>
|
||||
</mat-list-item>
|
||||
|
||||
<mat-list-item [routerLink]="['/player/equipment']" [routerLinkActive]="['active']">
|
||||
<mat-icon [class.active]="selected" matListIcon>local_mall</mat-icon>
|
||||
<a matLine>Equipment</a>
|
||||
</mat-list-item>
|
||||
|
||||
<mat-list-item [routerLink]="['/player/spells']" [routerLinkActive]="['active']">
|
||||
<mat-icon [class.active]="selected" matListIcon>brightness_4</mat-icon>
|
||||
<a matLine>Spells</a>
|
||||
</mat-list-item>
|
||||
|
||||
<mat-list-item [routerLink]="['/player/profile']" [routerLinkActive]="['active']">
|
||||
<mat-icon [class.active]="selected" matListIcon>account_circle</mat-icon>
|
||||
<a matLine>Profile</a>
|
||||
</mat-list-item>
|
||||
|
||||
<mat-list-item [routerLink]="['/player/shop']" [routerLinkActive]="['active']">
|
||||
<mat-icon [class.active]="selected" matListIcon>shopping_cart</mat-icon>
|
||||
<a matLine>Shop</a>
|
||||
</mat-list-item>
|
||||
|
||||
<mat-list-item [routerLink]="['/']" [routerLinkActive]="['active']">
|
||||
<mat-icon [class.active]="selected" matListIcon>exit_to_app</mat-icon>
|
||||
<a matLine>Log out</a>
|
||||
</mat-list-item>
|
||||
|
||||
</mat-nav-list>
|
||||
</mat-sidenav>
|
||||
<mat-sidenav-content class="content">Main content</mat-sidenav-content>
|
||||
</mat-sidenav-container>
|
||||
</div>
|
||||
|
@ -7,6 +7,7 @@ import { Component, OnInit } from '@angular/core';
|
||||
})
|
||||
export class PlayerDashboardComponent {
|
||||
isExpanded = false;
|
||||
selected = false;
|
||||
|
||||
collapse() {
|
||||
this.isExpanded = false;
|
||||
|
@ -27,6 +27,12 @@ namespace SessionCompanion.Configurations
|
||||
services.AddScoped<IRepository<Strength>, StrengthRepository>();
|
||||
services.AddScoped<IRepository<User>, UserRepository>();
|
||||
services.AddScoped<IRepository<Wisdom>, WisdomRepository>();
|
||||
services.AddScoped<IRepository<Armor>, ArmorRepository>();
|
||||
services.AddScoped<IRepository<CharacterArmor>, CharacterArmorRepository>();
|
||||
services.AddScoped<IRepository<OtherEquipment>, OtherEquipmentRepository>();
|
||||
services.AddScoped<IRepository<CharacterOtherEquipment>, CharacterOtherEquipmentRepository>();
|
||||
services.AddScoped<IRepository<Weapon>, WeaponRepository>();
|
||||
services.AddScoped<IRepository<CharacterWeapon>, CharacterWeaponRepository>();
|
||||
|
||||
return services;
|
||||
}
|
||||
|
@ -26,6 +26,13 @@ namespace SessionCompanion.Configurations
|
||||
services.AddScoped<IStrengthService, StrengthService>();
|
||||
services.AddScoped<IUserService, UserService>();
|
||||
services.AddScoped<IWisdomService, WisdomService>();
|
||||
services.AddScoped<IArmorService, ArmorService>();
|
||||
services.AddScoped<ICharacterArmorService, CharacterArmorService>();
|
||||
services.AddScoped<IOtherEquipmentService, OtherEquipmentService>();
|
||||
services.AddScoped<ICharacterOtherEquipmentService, CharacterOtherEquipmentService>();
|
||||
services.AddScoped<IWeaponService, WeaponService>();
|
||||
services.AddScoped<ICharacterWeaponService, CharacterWeaponService>();
|
||||
|
||||
return services;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user