Saturday 11 September 2010

Booya!

Hooray!!! After days of headaches trying to figure this thing out I've finally got the tree structure saving and loading the way I want it. Objects and folders are loaded into their correct parent folders, with the correct names, with the correct icons. Objects within the tree also save and load the objects data, booya!
Because I am using custom tree classes I had to learn how to write some custom serialization and deserialization to get things working properly. Not to mention a few recursive for loops to get things displaying correctly!

consider the fact that a for loop...well....loops...It does the same thing over and over again. Then consider in terms of programming recursion is the process of something running it's code again. I've essentially made something that loops...then half way through the loop it runs another loop....which runs the same loop under different circumstances...and so on. Even if you don't understand what I'm talking about you can understand where my headaches came from! I mean that alone sounds complicated. Imagine trying to figure out some of the numbers that you get after all those loops have been run! Crazy stuff!

But still, the reward is that I've learnt some new stuff. Hoorah! Knowledge is power you know. There's still some things I'd like to sort out, namely the ability to right click a folder and create a new folder/object directly within the folder that has been clicked. Also at the moment although objects and folders can be moved to different folders, once they are inside a folder, the order of them can't be changed. I'd like either some automatic sorting or manual organisation within folders. But for now I'm gonna go rest my poor head =(

No comments:

Post a Comment