SES-116 Create icons provider and show them on gm screen #45

Merged
s426128 merged 9 commits from SES-116 into dev 2020-12-30 12:19:56 +01:00
5 changed files with 16 additions and 1 deletions
Showing only changes of commit fe5921fa57 - Show all commits

View File

@ -23,7 +23,8 @@ namespace SessionCompanion.Services.Profiles
CreateMap<Character, CharacterBasicStatsViewModel>() CreateMap<Character, CharacterBasicStatsViewModel>()
.ForMember(vm => vm.Name, conf => conf.MapFrom(charact => charact.Biography.Name)) .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.Level, conf => conf.MapFrom(charact => charact.Statistics.Level))
.ForMember(vm => vm.CurrentHealthPoints, conf => conf.MapFrom(charact => charact.Statistics.CurrentHealthPoints)).ReverseMap(); .ForMember(vm => vm.CurrentHealthPoints, conf => conf.MapFrom(charact => charact.Statistics.CurrentHealthPoints))
.ForMember(vm => vm.Class, conf => conf.MapFrom(charact => charact.Biography.Class.Name)).ReverseMap();
} }
} }
} }

View File

@ -46,6 +46,7 @@ namespace SessionCompanion.Services.Services
{ {
var characters = await Repository.Get(c => charactersId.Contains(c.Id)) var characters = await Repository.Get(c => charactersId.Contains(c.Id))
.Include(x => x.Biography) .Include(x => x.Biography)
.ThenInclude(x => x.Class)
.Include(x => x.Statistics).ToListAsync(); .Include(x => x.Statistics).ToListAsync();
var result = Mapper.Map<IEnumerable<CharacterBasicStatsViewModel>>(characters); var result = Mapper.Map<IEnumerable<CharacterBasicStatsViewModel>>(characters);
return result; return result;

View File

@ -21,5 +21,10 @@
/// Aktualna ilość życia postaci /// Aktualna ilość życia postaci
/// </summary> /// </summary>
public int CurrentHealthPoints { get; set; } public int CurrentHealthPoints { get; set; }
/// <summary>
/// Klasa postaci
/// </summary>
public string Class { get; set; }
} }
} }

View File

@ -100,6 +100,11 @@
Aktualna ilość życia postaci Aktualna ilość życia postaci
</summary> </summary>
</member> </member>
<member name="P:SessionCompanion.ViewModels.CharacterViewModels.CharacterBasicStatsViewModel.Class">
<summary>
Klasa postaci
</summary>
</member>
<member name="P:SessionCompanion.ViewModels.CharacterViewModels.CharacterForLoginViewModel.Id"> <member name="P:SessionCompanion.ViewModels.CharacterViewModels.CharacterForLoginViewModel.Id">
<summary> <summary>
Identyfikator postaci Identyfikator postaci

View File

@ -72,6 +72,9 @@ namespace SessionCompanion.Controllers
public async Task<Either<List<CharacterBasicStatsViewModel>, ErrorResponse>> GetLoggedUsersCharacters() public async Task<Either<List<CharacterBasicStatsViewModel>, ErrorResponse>> GetLoggedUsersCharacters()
{ {
var connectedCharacters = _sessionHubData.ConnectedCharacters_Prop; var connectedCharacters = _sessionHubData.ConnectedCharacters_Prop;
connectedCharacters.Add("a", 1);
connectedCharacters.Add("s", 2);
connectedCharacters.Add("d", 3);
var characters = await _service.GetBasicCharactersData(connectedCharacters.Values.ToList()); var characters = await _service.GetBasicCharactersData(connectedCharacters.Values.ToList());
return characters.ToList(); return characters.ToList();