Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- so I was trying to solve the "changing display.hpp rebuilds All The Things" problem
- turns out the include tree is a mess...
- display is the parent of game_display and editor_display, so display.hpp is included in both of their headers.
- Now, game_display.hpp is included in mouse_events.hpp to implement a covariant overload of mouse_handler's base, mouse_handler_base.
- (mouse_handler is in mouse_events.hpp, FTR)
- Now
- play_controller.hpp then includes mouse_events.hpp, since it has a mouse_handler member.
- play_controller inherits from controller_base.
- controller_base is also the base of editor_controller.
- so the game and editor each have their own display classes (game_display and editor_display) and controller classes (play_controller and editor_controller), and each type has a base class (displayandcontroller_base`, respectively).
- editor_controller.hpp includes editor_display.hpp. That makes sense.
- But notice that play_controller.hpp didn't include game_display.hpp.
- March 12, 2018
- Vultraz - 03/12/2018
- Instead, it included it via the mouse_events.hpp included
- Since again, mouse_handler needs to implement a covariant override of a function it its own base.
- Here's where it gets interesting
- While play_controller has a mouse_handler member, editor_controller inherits from mouse_handler_base - which, again, is the base of mouse_handler.
- Both mouse_handler_base and controller_base declare pure virtual display reference getters.
- So editor_controller ends up overriding both!
- and the only reason play_controller doesn't do the same and only overrides the one from controller_base is that that class, for some reason, does NOT inherit from mouse_handler_base. It is instead its mouse_handler member that overrides that virtual getter
- Mess mess mess
- And the reason changing display.hpp means rebuilding so much is the direct include chain of
- display.hpp -> game_display.hpp -> mouse_events.hpp -> play_controller.hpp,
- the last of which is included in replay_controller.hpp, hotkey_handler.hpp, and playsingle_controller.hpp. Not to mention there's playmp_controller.hpp which includes playsingle_controller.hpp.
- :neutral_face:(edited)
- oh, and this is not counting for play_controller::hotkey_handler, which I can't find the declaration of, which on its own inherits from hotkey::command_executor_default, which has ANOTHER GODDAMN DISPLAY GETTER
- and is implemented by retuning a play_controller member's own override from controller_base
- (╯°□°)╯︵ ┻━┻
Advertisement
Add Comment
Please, Sign In to add comment