SES-132 Added new ViewModel and Profile

This commit is contained in:
Karol Górzyński 2021-01-07 17:38:36 +01:00
parent 136a68bda4
commit c0c8718eb0
3 changed files with 90 additions and 1 deletions

View File

@ -25,7 +25,15 @@ namespace SessionCompanion.Services.Profiles
.ForMember(vm => vm.Level, conf => conf.MapFrom(charact => charact.Statistics.Level)) .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.CurrentHealthPoints, conf => conf.MapFrom(charact => charact.Statistics.CurrentHealthPoints))
.ForMember(vm => vm.Class, conf => conf.MapFrom(charact => charact.Biography.Class.Name)).ReverseMap(); .ForMember(vm => vm.Class, conf => conf.MapFrom(charact => charact.Biography.Class.Name)).ReverseMap();
CreateMap<Character, CharacterBasicInfoViewModel>()
.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<Character, CharacterEveryStatViewModel>() CreateMap<Character, CharacterEveryStatViewModel>()
.ForMember(vm => vm.CanDeception, conf => conf.MapFrom(charact => charact.Charisma.CanDeception)) .ForMember(vm => vm.CanDeception, conf => conf.MapFrom(charact => charact.Charisma.CanDeception))
.ForMember(vm => vm.CanIntimidation, conf => conf.MapFrom(charact => charact.Charisma.CanIntimidation)) .ForMember(vm => vm.CanIntimidation, conf => conf.MapFrom(charact => charact.Charisma.CanIntimidation))

View File

@ -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
{
/// <summary>
/// Identyfikator postaci
/// </summary>
public int Id { get; set; }
/// <summary>
/// Nazwa postaci
/// </summary>
public string Name { get; set; }
/// <summary>
/// Poziom postaci
/// </summary>
public int Level { get; set; }
/// <summary>
/// Aktualna ilość życia postaci
/// </summary>
public int CurrentHealthPoints { get; set; }
/// <summary>
/// Maksymalna ilość życia psotaci
/// </summary>
public int MaxHealthPoints { get; set; }
/// <summary>
/// Klasa postaci
/// </summary>
public string Class { get; set; }
/// <summary>
/// Rasa postaci
/// </summary>
public string Race{ get; set; }
}
}

View File

@ -80,6 +80,41 @@
Płeć postaci Płeć postaci
</summary> </summary>
</member> </member>
<member name="P:SessionCompanion.ViewModels.CharacterViewModels.CharacterBasicInfoViewModel.Id">
<summary>
Identyfikator postaci
</summary>
</member>
<member name="P:SessionCompanion.ViewModels.CharacterViewModels.CharacterBasicInfoViewModel.Name">
<summary>
Nazwa postaci
</summary>
</member>
<member name="P:SessionCompanion.ViewModels.CharacterViewModels.CharacterBasicInfoViewModel.Level">
<summary>
Poziom postaci
</summary>
</member>
<member name="P:SessionCompanion.ViewModels.CharacterViewModels.CharacterBasicInfoViewModel.CurrentHealthPoints">
<summary>
Aktualna ilość życia postaci
</summary>
</member>
<member name="P:SessionCompanion.ViewModels.CharacterViewModels.CharacterBasicInfoViewModel.MaxHealthPoints">
<summary>
Maksymalna ilość życia psotaci
</summary>
</member>
<member name="P:SessionCompanion.ViewModels.CharacterViewModels.CharacterBasicInfoViewModel.Class">
<summary>
Klasa postaci
</summary>
</member>
<member name="P:SessionCompanion.ViewModels.CharacterViewModels.CharacterBasicInfoViewModel.Race">
<summary>
Rasa postaci
</summary>
</member>
<member name="P:SessionCompanion.ViewModels.CharacterViewModels.CharacterBasicStatsViewModel.Id"> <member name="P:SessionCompanion.ViewModels.CharacterViewModels.CharacterBasicStatsViewModel.Id">
<summary> <summary>
Identyfikator postaci Identyfikator postaci