I have a class of boxes that need to move around in a grid, but need to access that grid's coordinates in its methods. I don't want my classes to inherit the grid unless they need to. Do I need to pass the grid to the classes as a parameter, or make the box classes inherit from the grid class? Thanks.
This is the edit. Let me clarify. The classes of boxes need to know the length and width of the grid. Therefore, I need to call inside the class functions like Grid.length() and stuff. I need it though, to give me the length and width of the grid that was created.