Cuyler36 / MyHorizons

WIP Animal Crossing: New Horizons Save Editor
GNU General Public License v3.0
135 stars 33 forks source link

using ISaveFile instead of MainSaveFile so far as it's possible #25

Closed igromanru closed 4 years ago

igromanru commented 4 years ago

I remembered in the night, that there were an interface for MainSaveFile.

igromanru commented 4 years ago

Another change that I made just right now.
A user reported a bug.
PlayerSave throws and exception that prevents the whole MainSaveFile from being created, if there are another folders beside Villager(0-7).
I removed exception throwing for now, since the validation for PlayerSave is already done by "Valid" flag.

Cuyler36 commented 4 years ago

I wouldn't say that's a bug. Rather it's a result of the user putting files in the folder that aren't supposed to be there (unless there's a case where a folder that doesn't follow "VillagerX" is placed in the main save folder? This is something that should be reported to the user as it could get them flagged when they reupload their save. It could even cause it to be marked as "corrupt".

igromanru commented 4 years ago

Not really, the user can put any folder that he wants inside, started by BCAT.
If you make a BackUp of Device and BCAT with the same name, all files and folders will be in the same location.
Also MyHorizons has no exception handling. You should decide how you want to handle errors and do it everywhere the same way. Just throwing some exception at some point and hope that the application will handle them isn't a nice style. At the moment you're using the "Valid" Property to check, if an object was created successfully, I would keep it this way for now. And if you want to check, if the save is corrupt, you should rather check files inside or even the content

In my case I don't even interested in Players. I don't know if you have seen already, I made a simple tool to show Stalk Market for the current week. I'm using MyHorizons library to parse the save. https://github.com/igromanru/ACNH-Turnips-Fortune-Teller

I like it, that you started the save parsing part as it's own project/library and I would be if it could be used in several ways.