chorhatarahuduketuri / gc

GalacticConquest
0 stars 0 forks source link

Code refactoring world model #18

Closed chorhatarahuduketuri closed 6 years ago

chorhatarahuduketuri commented 6 years ago

How should we refactor the world model? At the least, we should move things like sectors and ships out of logic/ and into model/.

How should we store ships? With references to positions in the galaxy? Or should we just have a grid of sectors that contain systems & ships and just have space at the top of a hierarchical model?

adrianlshaw commented 6 years ago

Sectors and Ships are already in the model package.

A grid (space) as the root structure seems better. When the player presses End Turn, almost every sector in the game will likely need some form of processing or update. Whereas, when the screen needs to be redrawn, then only the visible sectors on the screen will be directly accessed. This is much more efficient than scanning each list for objects that only might be visible on the screen in order to render them.

chorhatarahuduketuri commented 6 years ago

Agreed and implemented.

Further restructuring can come under later and more specific issues.