☂️ Game engine: Issues with general code organisation #3200
Labels
easy
Simple task that doesn't require understanding the code much
☂️ umbrella
tracks multiple issues at once
We have some issues with general organisation of code:
game
,map
,item
,Creature
and all its children:monster
,Character
,player
,npc
,avatar
. Besides the standard problems of "god objects", these classes also form some of the biggest and most included headers we have, which negatively affects compilation times for both clean and incremental builds. Ideally these classes should be broken up, or stripped of methods that can be converted into free functions (especially those methods that only operate on other public methods and those that don't touch the object at all). Some effort has been done on this front, but nothing substantial.src
, with no clean separation for frontend/backend, or purpose, or library they belong to. Moving everything to subdirectories may not be desirable since that'd ruin compatibility with DDA (unless we decide we don't care about that), but some parts at least could be moved out of the way.output.h
header contains a mix of string formatting code, generic UI output code, item-specific UI code, UI management code and UI widgets, butcursesdef.h
also contains UI code, as well ascursesport.h
andui.h
, butui.h
also has widgets and helpers, and there's alsoui_manager.h
that has UI management code, and various other headers such ascalendar.h
can have their own formatting functions.We have inherited large code migration projects, those will have to be finished eventually: Vestigial code oddities #318 (comment)Moved to ☂️ Game engine: Ongoing code migration projects #3271The text was updated successfully, but these errors were encountered: