/// <summary> /// Makes a new FileReader(Shoudld have changed that name) and inits the types of available writters. /// Fixes source path for the file writters. /// Calls DataHandler to get the correct File writter and write the contents into the source file. /// </summary> /// <param name="source"></param> public override void ExportCardsToSource(string source) { fileReaders = new FileReaders(); DataWriter = fileReaders.InitWriterrDict(); source = EXPORT_ASSET_PATH + source; DataHandler(source, FileModes.Write); }
/// <summary> /// Imports the card data from a source file. /// Gets a new FileReader and init the FileReader. /// If all the cards are read correctly, create/update the Scriptable Objects. /// </summary> /// <param name="source"></param> public override void ImportCardsFromSource(string source) { fileReaders = new FileReaders(); DataReader = fileReaders.InitReaderDict(); currentCards = DataHandler(source, FileModes.Read); if (currentCards != null) { AddCardAssets(); } }