8. File Descriptions - Adam101112595/BattleShip GitHub Wiki

Battleships File Descriptions

Battleships/src

DeploymentController.vb

Manages the interactions at the end of the game

  • Draw endgame screen (show win/lose)
  • Handle user input

DiscoveryController.vb

Manages the input during gameplay

  • Clicking mouse will attack locations
  • Draws game as things happen

GameLogic.vb

Game Loop that creates the game and calls load and unload game resources

  • Music, the screen

GameController.vb

Controls game, manage user input and display the games current state

  • Returns game state, indicating what is being displayed
  • You can start game
  • Code “listens” for user input and changes to display those changes

GameResources.vb

This is called when the game needs to load resources into memory to be used

GameState.vb

Used to display different states of gameplay

  • If the game requires to show the main menu, it will call the main menu game state

MenuController.vb

Handles drawing menu drawing and user interactions

  • Eg draw setup and user ca click to choose difficulty

HighScoreController.vb

Controls collecting and displaying high score data

  • Saved into txt file

UtilityFunctions.vb

Mouse drawing and interacting utilities

  • Also draws player ships and grid
  • Gameplay related functions and images

DeploymentController.vb

Controls player actions during ship deployment state

  • Select and place ships
  • Draws deployment screen and which ships can be deployed

Battleships/src/Model

AIHardPlayer.vb

AI handler on hard difficulty.

  • More objects and methods to make AI more difficult.

AIMediumPlayer.vb

AI handler on medium difficulty.

AIOption.vb

Determines AI difficult.

  • Allowing player to choose AI difficult

AIPlayer.vb

AI attack methods.

  • When a ship has been hit, it will continue attacking

AttackResult.vb

Give results after a move has been made, a miss or a hit.

BattleShipGame.vb

Add players into the game.

  • Ensure that their ships are deployed before the game begin
  • Control players’ turns and whether their ship is destroyed.

Direction.vb

Determines ships direction.

  • Horizontally or vertically

ISeaGrid.vb

Defines grid interface.

Player.vb

Define player’s grid and an enemy’s grid for attacking or when attacked

  • Show players their grid
  • Show empty grid for attacking

ResultOfAttack.vb

Display results or a move

  • A hit, miss, destroyed ship, already shot and game over.

SeaGrid.vb

Define ship on the grid.

SeaGridAdapter.vb

Allowing change for sea grid view

  • Update view of sea grid tiles instead of a ship tile

Ship.vb

  • Determine ships' properties
  • Name, size etc.

ShipName.vb

List ship name in an enumeration

Tiles.vb

Determine tiles location on the grind

  • Whether the tiles is a ship or whether it’s been shot

TilesView.vb

Interface view of the sea, ships, hits and misses.