Original Post
I'm making a artificial life ecosystem simulation game that has plants and creatures that die and born all the time. There are classes for the "model" part of the game: world, objects etc. and then there is a visualization class "worldgraphics" that draws everything and a top level worldGUI from top level simulation/game control. I am using C++. I want to preserve the model/GUI separation. There are a lot of stuff to visualize (world contains objects. objects has many attributes (and are draw differently!) and many derives classes with their own attributes. How are those games generally done when visualization part need to know almost everything because it draws everything. At the same time good practice is to provide the data from well-defined interface to not allow everyone to access everything wildly. I have some options: - make huge amount of get/set-methods for the objects --> seems too heavy - make every attribute public and include all classes to graphics class --> seems "unorthodox" method - in object side, make graphics as friend of the object class (base and derived classes) - in object side, make graphics as friend of the object class (base and derived classes) - define some other interface/pattern/architecture..???