Collaborating with Ptolemy, we have built a Battleships game engine using test-driven design. This is one of our first attempt to apply TDD and OOD. Also, it is our first attempt to apply SOLID principles.
Responsibility |
Collaborators |
Be hit? |
Players, Board |
Sink |
Board |
Be placed |
Board, Players |
possibility: (class Primary Grid << Tracking Grid)
Responsibility |
Collaborators |
Record ship |
Ship |
Record shots |
Player |
Responsibility |
Collaborators |
Shoot |
Board |
Place ship |
Ship, Board |
Responsibility |
Collaborators |
Set Board |
Players |
Start game |
Board, Players |
Decide turn |
Players |
Finish game |
Players, Board |
Save game |
Board |