Hello , I'm currently working on my 2d tile based game . For the convenience of development, I divided the world into chunks and store them in the world object. In turn, the chuck has an array with pointer objects (blocks).
My block class have virtual Update() method, also the block class is the parent for some others classes(for example furnace or assembly machine), and each of this children classes have their own overwritten Update() methods. Then I'm need to iterate every block in chunks , I just call Update() method for every block in my block array. But some of block class child have Update() methods that need to have access for world or chunk object(for example, for checking neighbor blocks), this causes recursive include problem. Chunk class includes block(or block child), on the other hand block(block child) class includes chunk class.
So how I should handle Update method , if block object should have access to world ?
P.S I'm not sure if I explained the problem well, so let me know if something is not clear