Skip to content

Commit

Permalink
Adding Experience points handler
Browse files Browse the repository at this point in the history
  • Loading branch information
KrystianKempski committed Feb 21, 2024
1 parent d584e45 commit 6e91122
Show file tree
Hide file tree
Showing 15 changed files with 1,478 additions and 77 deletions.
8 changes: 4 additions & 4 deletions DA_Business/Repository/CharacterReps/CharacterRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ public async Task<CharacterDTO> Update(CharacterDTO objDTO)
var obj = await _db.Characters.FirstOrDefaultAsync(u => u.Id == objDTO.Id);
if (obj != null)
{
//obj.Attributes = _mapper.Map<ICollection<AttributeDTO>, ICollection<Attribute>>(objDTO.Attributes);
//obj.BaseSkills = _mapper.Map<ICollection<BaseSkillDTO>, ICollection<BaseSkill>>(objDTO.BaseSkills);
// obj.SpecialSkills = _mapper.Map<ICollection<SpecialSkillDTO>, ICollection<SpecialSkill>>(objDTO.SpecialSkills);

obj.Age = objDTO.Age;
obj.NPCName = objDTO.NPCName;
obj.Race = objDTO.Race;
obj.Class = objDTO.Class;
obj.CurrentExpPoints = objDTO.CurrentExpPoints;
obj.UsedExpPoints = objDTO.UsedExpPoints;
obj.AttributePoints = objDTO.AttributePoints;
obj.NPCType = objDTO.NPCType;
_db.Characters.Update(obj);
await _db.SaveChangesAsync();
// return _mapper.Map<Object, CharacterDTO>(obj);
Expand Down
5 changes: 5 additions & 0 deletions DA_DataAccess/CharacterClasses/Character.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ public class Character
public string? Race { get; set; }
public int Age { get; set; }
public string? ImageUrl { get; set; }

public string? NPCType { get; set; }
public int AttributePoints { get; set; }
public int CurrentExpPoints { get; set; }
public int UsedExpPoints { get; set; }
//public int UserId { get; set; }
//[ForeignKey(nameof(UserId))]
public ICollection<Attribute>? Attributes { get; set; }
Expand Down
Loading

0 comments on commit 6e91122

Please sign in to comment.