public static FullCharacterDTO FullDTOFromCharacter(Character character) { var characterDTO = new FullCharacterDTO(); characterDTO.id = character._id; characterDTO.playerAccountName = character.PlayerAccountName; characterDTO.name = character.Name; characterDTO.race = character.Race; foreach (Ability ability in character.Abilities) { var abilityDTO = AbilityMapper.GetDTOFromAbility(ability); characterDTO.abilities.Add(abilityDTO); } characterDTO.size = character.Size; characterDTO.sizeModifier = character.SizeModifier; characterDTO.classes = new List <RpgClassDTO>(); foreach (RpgClass rpgClass in character.Classes) { var rpgClassDTO = RpgClassMapper.GetDTOFromClass(rpgClass); characterDTO.classes.Add(rpgClassDTO); } return(characterDTO); }
public static BasicCharacterDTO BasicDTOFromCharacter(Character character) { var characterDTO = new BasicCharacterDTO(); characterDTO.id = character._id; characterDTO.playerAccountName = character.PlayerAccountName; characterDTO.name = character.Name; characterDTO.race = character.Race; characterDTO.classes = new List <RpgClassDTO>(); foreach (RpgClass rpgClass in character.Classes) { var rpgClassDTO = RpgClassMapper.GetDTOFromClass(rpgClass); characterDTO.classes.Add(rpgClassDTO); } return(characterDTO); }