ChrisViral / HydroTech

RCS docking autopilot/docking came for KSP
1 stars 0 forks source link

Get rid of the File loading system #9

Open ChrisViral opened 8 years ago

ChrisViral commented 8 years ago

This one is old and dates of System.IO being locked. It's far too complex and makes very little sense. Need to convert that to a classical ConfigNode saving method.

ChrisViral commented 8 years ago

Got rid of the old system in b58eb83, however a new system needs to be implemented.

MichaelKim0407 commented 8 years ago

I believe I created this file loading system because ConfigNode does not deal with different value types automatically, and loading/saving needs to be written in methods, which is quite repetitive and often leads to mistakes - you need to remember to add loading/saving sequence after adding a property. My system handles everything automatically with attributes. However the project is now yours so do anything you like

ChrisViral commented 8 years ago

@MichaelKim0407 yes, it's what I understood from it. However, things have changed over the years :P ConfigNode now has an innate way of doing this through IConfigNode and ConfigNode.LoadObjectFromConfig and ConfigNode.SaveObjectToConfig. However, the ConfigNode extensions I made for RealChute have now been merged into the ConfigNode class of the game itself, and I'm thinking of using that directly and handling things myself. If it proves to be too error prone, I'll switch the the ConfigNode auto load/save.

MichaelKim0407 commented 8 years ago

@StupidChris Great then! If you have any questions feel free to ask me - I should still understand what I wrote :D

ChrisViral commented 8 years ago

Glad to see you hanging around and taking a look at this! Don't be afraid to comment on anything :P I try to document what I'm doing to keep track of where I'm going.