예제 #1
0
        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);
        }
예제 #2
0
        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);
        }