UML Class Diagrams - OSU-CS361-W17/group1_project3 GitHub Wiki

Current

The original design did not have civilian or stealth ships. It looked like this: Current Class Diagram by Daniel Kato

Expected

The designed plan had one class that was inherited. ArrayList objects stored different ship types that could be identified individually by the JavaScript. Extra loop structures were required for this design to separate ships by type, and did not optimize inheritance. ![Expected Class Diagram] https://docs.google.com/document/d/1tx2fBxkBl0qQ1T_NfTse4u8tPCqQJ_nDY5Mi9M5UnuA/edit?usp=sharing

Implemented

This design has 2 inherited classes and 1 additional class. Removed the extra array lists, and created a new class for stealth ships. The ship subclasses are constructed with different values of the new variable "type". The new class "ShotData" contains data for JavaScript to read after taking in a JSON object. This allows JavaScript to display different image files and play sounds for each ship type. Inheritance is also applied in the BattleShip model with the ship constructors and a new function that adds the ShotData to a hit list. Implemented Class Diagram