Files with Descriptions - ThindAmrit17/Battleship GitHub Wiki

All the files provided with their description

Battleship

README.md: A readme file that outlines the requirements of the code and basic instructions on how to run the program.

Build.sh: A shell file that debugs and compiles all the code together.

Clean.sh: Is a shell file that

contributors.txt: Is a text file that shows who contributed to the source code of the battleship project.

out.log: is a log of all the messages and alerts from compiling the code.

run.sh: Is a shell file that runs the battleship program.

Resources

HighScores.txt: Is where the high scores are saved to.

Swingame.ico: Swingame Icon

Swingame.icns: Swingame file

Animations: A folder containing the animations for the startup and splash screen.

Fonts: A folder containing all the font files. Arial, Cour, ffaccess, maven_pro_regular.

Images: A folder containing all the images that are used in the game.

Panels: A folder that contains the file that controls how the GUI is set up.

Sounds: A folder that contains all the sound files that are used in the battleship game.

src

DeploymentController.vb: This file handles the user input during the deployment phase. This includes, ships, deploying ships, changing the direction of the ships, randomising deployment and ending deployment.

DiscoveryController.vb: This file deals with the battle phase. Handles the discovery input of the game and draws the game during the attack phase.

EndingGameController.vb: This file is responsible for handling the interactions at the end of the game. Shows the win/lose status, reading in the highsSwinGame.

GameController.vb: This file controls the game, manages the user input and displays the current state of the game. Changes AI settings based on user defined value.

GameLogic.vb: This module file handles the graphics window, loads the resources and frees the resources and handles the game loop.

GameResources.vb: This module file handles all the resources.

GameState.vb: This file is responsible for representing the state of the game. E.G. whether it's in the main menu, the game menu, the high scores menu etc.

HighScoreController.vb: This module file handles the saving, reading, drawing, format of the high score data.

MenuController.vb: This module file handles all the menu inputs from the main menu, game menu and the settings menu.

UtilityFunctions.vb: This module file includes a number of utility methods for drawing and interacting with the mouse.

Model

AIHardPlayer.vb: This file is a hard AI setting. This player know the direction of ships once it has hit it twice. If the ship has not been destroyed it will shoot the other way. If the ship still hasn't been destroyed then it will know it has hit multiple ships.

AIMediumPlayer.vb: This file is a medium AI setting. It will try to destroy a ship if it has hit a ship.

AIOption.vb: This file is a Enumeration of all the AI settings. Hard, medium and easy.

AIPlayer.vb: This file is a type of player. It has the ability to randomly deploy ships and has the functionality to generate coordinates and shoot at tiles.

AttackResult.vb: This class file handles the result of an attack after a shot has been made.

BattleShipsGame.vb: This class file controls most of the game. It Add both players to the game and checks to make sure both players are added before starting the game. Allows the player to shoot and changes the turn to the other player. Checks if the players have been destroyed.

Direction.vb: This file is the enumeration of the ships direction. UpDown, LeftRight.

ISeaGrid.vb: This interface file is the read only interface of the grid. It allows the player to see and attack their opponents grid.

Player.vb: This class files handles the interface of the player. It can also check if all the ships have been destroyed.

ResultOfAttack.vb: This file is the enumeration of all the possible results of an attack. Hit, Miss, Destroyed, ShotAlready, GameOver.

SeaGrid.vb: This class file is the grid itself. This can also be used with SeaGridAdapter to mask the position of the ships.

SeaGridAdapter.vb: This clas file allows a ship tile to be changed to a sea tile.

Ship.vb: This class file is the ship itself. Within this class it has the shipname, size, number of hits and location. It is able to add tiles, remove hits taken and if its destroyed or deployed.

ShipName.vb: This file has the enumeration of all the shipnames. none = 1, tug = 2, submarine = 3, destroyer = 4, battleship = 4, Aircraft carrier = 5.

Tile.vb: This class file is the location on the grid. It will know if it has a ship on it or if it has been shot.

TileView.vb: This file is the enumeration of the TileView. Sea, Miss, Ship, Hit.