File descriptions - camfush/Battleship GitHub Wiki

DeploymentController.vb

  • The DeploymentController controls the players actions during the deployment phase.

DiscoveryController.vb

  • The battle phase is handled by the DiscoveryController.

EndingGameController.vb

  • The EndingGameController is responsible for managing the interactions at the end of a game.

GameController.vb

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

GameLogic.vb

  • The GameLogic module has functions for basic game functionality.

GameResources.vb

  • GameResources loads basic resources required by the game, such as fonts, images and sounds.

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 a number of utility methods for drawing and interacting with the Mouse.

Within the "Model" folder

AIHardPlayer.vb

  • This handles the interaction and behaviour for the AI in hard mode. It will have small advantages that make it more difficult to play against.

AIMediumPlayer.vb

  • This handles the interaction and behaviour for the AI in medium mode. It will try and destroy a ship if it has found one of it's tiles.

AIPlayer.vb

  • This handles the interaction and behaviour for the standard AI. It randomly shoots at tiles with no real method.

AttackResult.vb

  • This gives the result after a shot has been made, including a text description, returning the ship if involved, and the column/width of the attack.

BattleShipsGame.vb

  • This controls a big part of the game. It adds both players to the game session and ensures all ships are deployed before starting. It also controls the shooting by players and the switching of turns.

Direction.vb

  • This controls which direction the ships can be oriented; either LeftRight or UpDown.

ISeaGrid.vb

  • This controls the visual interface of the grid, allowing players to both see and attack their opponent grid.

Player.vb

  • This manages the player object. It has it's own grid as well as an enemy grid. A player object can also attack it's opponent.

ResultOfAttack.vb

  • This handles the results of an attack using enumeration. The results can be Hit, Miss, Destroyed, ShotAlready, and GameOver.

SeaGrid.vb

  • This is responsible for creating the grid that the game uses for it's gameplay. It is used in conjunction with other objects to place ships and mark attacks etc.

SeaGridAdapter.vb

  • This changes the above SeaGrid from a sea tile to a ship tile, or vice versa depending on the state of the gameplay and user controls.

Ship.vb

  • This contains all the information about the ship object (itself). E.g. It's name, size, hits taken and location. If a ship is hit/deployed/destroyed the ship object will know/alter it's state to match.

ShipName.vb

  • Contains all possible names for the ships within the game, as an enumeration.

Tile.vb

  • This is the object that makes up the SeaGrid. It knows its location on the grid, whether or not it is a ship as well as if it has been shot.

TileView.vb

  • The different states that a tile can be in, which determines it's view. It can be Sea, Miss, Ship or Hit.