/// <summary>
        /// Creates a unique file name for a player character file.
        /// </summary>
        /// <param name="character"></param>
        /// <param name="playerProfile"></param>
        /// <returns></returns>
        private string CreateUniqueFileName(PlayerCharacter character, string username)
        {
            string extension = FileExtensionFactory.GetFileExtension(FileTypeEnum.PlayerCharacter);
            string directoryPath = DirectoryPaths.CharacterVaultDirectoryPath + username + "/";
            string fileName = character.FirstName + character.LastName;

            foreach (char currentCharacter in Path.GetInvalidFileNameChars())
            {
                fileName = fileName.Replace(currentCharacter.ToString(), "");
            }
            fileName = fileName.Replace(" ", "");

            string originalFileName = fileName;
            int index = 1;
            while (File.Exists(directoryPath + fileName + extension))
            {
                fileName = originalFileName + index;
                index++;
            }

            fileName += extension;
            return fileName;
        }
        /// <summary>
        /// Serializes a specified player character object to the appropriate file path.
        /// </summary>
        /// <param name="character"></param>
        /// <returns>Returns the modified PlayerCharacter object</returns>
        public PlayerCharacter SerializePlayerCharacterFile(PlayerCharacter character, string username)
        {
            if (String.IsNullOrWhiteSpace(character.FileName))
            {
                character.FileName = CreateUniqueFileName(character, username);
            }

            string filePath = DirectoryPaths.CharacterVaultDirectoryPath + username + "/" + character.FileName;

            if (!Directory.Exists(DirectoryPaths.CharacterVaultDirectoryPath))
            {
                // Create the character vault directory
                Directory.CreateDirectory(DirectoryPaths.CharacterVaultDirectoryPath);
            }

            if (!Directory.Exists(DirectoryPaths.CharacterVaultDirectoryPath + username))
            {
                // Create the user's folder
                Directory.CreateDirectory(DirectoryPaths.CharacterVaultDirectoryPath + username);
            }

            try
            {
                XmlSerializer serializer = new XmlSerializer(typeof(PlayerCharacter));
                using (FileStream stream = new FileStream(filePath, FileMode.Create))
                {
                    serializer.Serialize(stream, character);
                }
            }
            catch
            {
                throw;
            }

            return character;
        }