From c0c8718eb060d0c8709475391f3528455c3639ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=20G=C3=B3rzy=C5=84ski?= Date: Thu, 7 Jan 2021 17:38:36 +0100 Subject: [PATCH] SES-132 Added new ViewModel and Profile --- .../Profiles/CharacterProfile.cs | 10 +++- .../CharacterBasicInfoViewModel.cs | 46 +++++++++++++++++++ .../SessionCompanion.ViewModels.xml | 35 ++++++++++++++ 3 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 SessionCompanion/SessionCompanion.ViewModels/CharacterViewModels/CharacterBasicInfoViewModel.cs diff --git a/SessionCompanion/SessionCompanion.Services/Profiles/CharacterProfile.cs b/SessionCompanion/SessionCompanion.Services/Profiles/CharacterProfile.cs index 8893dd7..e856387 100644 --- a/SessionCompanion/SessionCompanion.Services/Profiles/CharacterProfile.cs +++ b/SessionCompanion/SessionCompanion.Services/Profiles/CharacterProfile.cs @@ -25,7 +25,15 @@ namespace SessionCompanion.Services.Profiles .ForMember(vm => vm.Level, conf => conf.MapFrom(charact => charact.Statistics.Level)) .ForMember(vm => vm.CurrentHealthPoints, conf => conf.MapFrom(charact => charact.Statistics.CurrentHealthPoints)) .ForMember(vm => vm.Class, conf => conf.MapFrom(charact => charact.Biography.Class.Name)).ReverseMap(); - + + CreateMap() + .ForMember(vm => vm.Name, conf => conf.MapFrom(charact => charact.Biography.Name)) + .ForMember(vm => vm.Level, conf => conf.MapFrom(charact => charact.Statistics.Level)) + .ForMember(vm => vm.CurrentHealthPoints, conf => conf.MapFrom(charact => charact.Statistics.CurrentHealthPoints)) + .ForMember(vm => vm.MaxHealthPoints, conf => conf.MapFrom(charact => charact.Statistics.HealthPoints)) + .ForMember(vm => vm.Race, conf => conf.MapFrom(charact => charact.Biography.Race.Name)) + .ForMember(vm => vm.Class, conf => conf.MapFrom(charact => charact.Biography.Class.Name)).ReverseMap(); + CreateMap() .ForMember(vm => vm.CanDeception, conf => conf.MapFrom(charact => charact.Charisma.CanDeception)) .ForMember(vm => vm.CanIntimidation, conf => conf.MapFrom(charact => charact.Charisma.CanIntimidation)) diff --git a/SessionCompanion/SessionCompanion.ViewModels/CharacterViewModels/CharacterBasicInfoViewModel.cs b/SessionCompanion/SessionCompanion.ViewModels/CharacterViewModels/CharacterBasicInfoViewModel.cs new file mode 100644 index 0000000..dce943c --- /dev/null +++ b/SessionCompanion/SessionCompanion.ViewModels/CharacterViewModels/CharacterBasicInfoViewModel.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SessionCompanion.ViewModels.CharacterViewModels +{ + public class CharacterBasicInfoViewModel + { + /// + /// Identyfikator postaci + /// + public int Id { get; set; } + + /// + /// Nazwa postaci + /// + public string Name { get; set; } + + /// + /// Poziom postaci + /// + public int Level { get; set; } + + /// + /// Aktualna ilość życia postaci + /// + public int CurrentHealthPoints { get; set; } + + /// + /// Maksymalna ilość życia psotaci + /// + public int MaxHealthPoints { get; set; } + + /// + /// Klasa postaci + /// + public string Class { get; set; } + + /// + /// Rasa postaci + /// + public string Race{ get; set; } + } +} diff --git a/SessionCompanion/SessionCompanion.ViewModels/SessionCompanion.ViewModels.xml b/SessionCompanion/SessionCompanion.ViewModels/SessionCompanion.ViewModels.xml index 96bcdc6..0069b97 100644 --- a/SessionCompanion/SessionCompanion.ViewModels/SessionCompanion.ViewModels.xml +++ b/SessionCompanion/SessionCompanion.ViewModels/SessionCompanion.ViewModels.xml @@ -80,6 +80,41 @@ Płeć postaci + + + Identyfikator postaci + + + + + Nazwa postaci + + + + + Poziom postaci + + + + + Aktualna ilość życia postaci + + + + + Maksymalna ilość życia psotaci + + + + + Klasa postaci + + + + + Rasa postaci + + Identyfikator postaci