(09-18-2015, 05:46 PM)piotrdz Wrote: 2. Split level loading code from CRobotMain (easy):This might not be as easy as it sounds because it references loading of saved scenes in a really dirty way (in BeginObject command).
- CRobotMain::CreateScene() should go into dedicated class, for example CLevelLoader
- each if (line->GetCommand() == "...") should be implemented as lookup in a dictionary containing mapping of: command -> pointer to member function handling this command
Also, the code for loading saved scenes in split all over the place (some in the UI classes for loading the title for display in the list, some in CPlayerProfile for finding correct level file to load and finally a BeginObject hook in CRobotMain while the level is being loaded)
@EDIT: Actually, I think I already moved it out of UI classes. I'm not sure though.