public CharacterManager() { try { _characterList = CharacterDataAccessor.RetrieveCharacterList(); } catch (Exception) { throw; } } // End CharacterManager
} // End EditCharacter() // This method takes a character that will be added to the characterlist.csv file and a statblock that will // saved to a a seperate file. public List <Character> AddCharacter(Character character, CharacterStatBlock characterStatBlock) { try { if (CharacterDataAccessor.AddCharacter(character, characterStatBlock)) { _characterList = CharacterDataAccessor.RetrieveCharacterList(); } return(_characterList); } catch (Exception) { throw; } } // End AddCharacter()
} // End of FetchCharacterStatBlock() // This method will take a character and a stat block to replace on that is already in the character list // at the index that is entered. public List <Character> EditCharacter(Character character, CharacterStatBlock characterStatBlock, int characterIndex) { try { _characterList[characterIndex] = character; if (CharacterDataAccessor.UpdateCharacter(characterIndex, characterStatBlock, _characterList)) { _characterList = CharacterDataAccessor.RetrieveCharacterList(); return(_characterList); } return(_characterList); } catch (Exception) { throw; } } // End EditCharacter()