amir-hadzic / FitGamePack

A simple library for writing 2D games as well as a few simple games built on top of it. Initially created for the Faculty of Information Technologies in Mostar as part of a competition.
https://github.com/amir-hadzic/FitGamePack/wiki
GNU General Public License v3.0
1 stars 0 forks source link

Create a grid entity class for TicTacToe #4

Closed amir-hadzic closed 13 years ago

amir-hadzic commented 13 years ago

TicTacToe is currently using the GridEntity to implement some game logic and this has resulted with the GridEntity destroying the entities that are not created by it in its destructor and in removeEntity(). This is fine for the TicTacToe sample but will probably be problematic if used in other games.

A special grid entity class should be created for the TicTacToe sample and the GridEntity class should be fixed to not delete anything that wasn't allocated by it.

amir-hadzic commented 13 years ago

I haven't created a special class for TicTacToe as that would only complicate the design. GridEntity is now called GridPanel and it doesn't delete the associated entitity when it's destructed.