Detailed description of files - manjil21/Battleships GitHub Wiki

AIHardPlayer.vb This file contains a class AIHardPlayer, that inherits AIPlayer. It is a type of player. This AI will know the directions of ships, and when it has found 2 ship tiles, will try to destroy that ship. If that ship is not destroyed, it will shoot the other way. If the ship is still not destroyed, then the AI knows that it has hit multiple ships. Then it will try to destroy all around the tiles that has been hit.

AIMediumPlayer.vb This file contains a class AIMediumPlayer, that inherits AIPlayer. It is a type of player. This AI will try to destroy a ship if it has found a ship.

AIOption.vb This file contains an enum AIOption, which has values for Easy, Medium and Hard.

AIPlayer.vb This file contains the class AIPlayer, which is a type of Player. It contains AI functionality that can randomly deploy ships. It also has functionality to generate co-ordinates and shoot at tiles.

AttackResult.vb This file contains the AttackResult class. It gives the result after a shot has been made.

BattleShipsGame.vb This file contains the BattleShipsGame class. It will add the two players to the game and make sure that both players ships are deployed before starting the game. It allows players to shoot, and swap turns between the players. It also checks if any player’s ships have been destroyed.

Direction.vb This file contains an enum Direction that has values for Left, Right, Up and Down.

ISeaGrid.vb This file contains an interface ISeaGrid. It allows each player to see and attack their opponents grid.

Player.vb This file contains the Player class. It contains functionality for a Player object. It allows the player object to see its own grid, the enemy grid. It can also check if all ships are deployed, and if all ships are destroyed. It also allows the player to attack a tile.

ResultOfAttack.vb This file contains an enum ResultOfAttack, that has values for Hit, Miss, Destroyed, ShotAlready and GameOver.

SeaGrid.vb This file contains a class SeaGrid, that implements the interface ISeaGrid. It is the grid upon which ships are deployed. The grid is only viewable through ISeaGrid interface as a read only grid. It can be used in conjunction with SeaGridAdapter to hide the position of the ships.

SeaGridAdapter.vb This file contains a class SeaGridAdapter, that implements ISeaGrid. It allows for the tile view to be changed between sea tiles and ship tiles.

Ship.vb This file contains a class Ship. This class contains the functionality for a ship object. The ship object knows its name, size, number of hits taken, and the location. It can also add tiles, remove tiles, change the hits taken, and know if it is deployed or destroyed. Deployment information is added to allow ships to be drawn.

ShipName.vb This file contains an enum ShipName. It contains the values for None, Tug, Submarine, Destroyer, Battleship and AircraftCarrier.

Tile.vb This file contains a class Tile. A Tile object knows its location on the grid, knows if it is a ship and also if it has been shot before.

TileView.vb This file contains an enum TileView. It contains the values for Sea, Miss, Ship and Hit.

DeploymentController.vb The Deployment controller controls the player’s actions during the deployment phase.

DiscoveryController.vb The battle phase is handled by the DiscoveryController.

EndingGameController.vb Responsible for managing the actions at the end of the game

GameController.vb The GameController is responsible for controlling the game, managing user input, and displaying the current state of the game

GameLogic.vb Opens new graphic windows, run game loops ,free resources and close audio to end the game

GameRescources.vb Loads the resources for the game.

GameState.vb The GameStates represent the state of the Battleships game play. This is used to control the actions and view displayed to the player

HighScoreController.vb Controls displaying and collecting high score data.

MenuController.vb The menu controller handles the drawing and user interactions from the menus in the game. These include the main menu, game menu and the settings menu.

UtilityFunctions.vb This includes several utility methods for drawing and interacting with the Mouse