• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

111 Neutral

About Cithoge

  • Rank
  1. Classes, Engine and Ownership.

    I would say this definitely belongs in the Grid class. The Engine shouldn't have to worry about what the default state of the Grid looks like - it should be content to know the Grid has been reset, never worrying about the specifics of how. Not only will it make the code easier to read, it will make it easier to make changes later. Say you want to implement a hexagonal grid, or a 3D grid, or whatever; if the resetting code resides in the Engine, you will have to change it; if it's handled by the Grid class, you can simply replace it with a new Grid class. As long as it implements the reset() method, the Engine won't know the difference - and shouldn't have to. (In practice it will likely not be that simple, of course - but the principle holds.)
  • Advertisement