K. Code Documention (part 2) - SwinbeeMiles/MyBattleship GitHub Wiki

Documented by: Zikri Dawek

The following are the newly added comments on the functions and modules that do not have their respective comments.

GameController.cs

  1. PlayHitSequence(...) - Plays the corresponding animation sequence and sound if an explosion animation was carried out.
  2. PlayMissSequence(...) - Plays the corresponding animation sequence and sound if a splash animation was carried out.
  3. GameController() - Initializes the state that the player is inhabiting in the main menu.

GameResources.cs

  1. LoadFonts() - Loads the fonts.
  2. LoadImages() - Loads the images.
  3. LoadSounds() - Loads the sounds.
  4. LoadMusic() - Loads the music.
  5. LoadResources() - Loads the resources.
  6. ShowLoadingScreen() - Shows the loading screen.
  7. PlaySwinGameIntro() - Plays the SwinGame intro.
  8. ShowMessage() - Shows the message.
  9. EndLoadingScreen() - Ends the loading screen.
  10. NewFont(...) - Loads custom font from the resource folder.
  11. NewImage(...) - Loads custom images from the resource folder.
  12. NewTransparentColorImage(...) - Loads a custom type of images from the resource folder.
  13. NewTransparentColorImage(...) - Loads a custom type of images from the resource folder.
  14. NewSound(...) - Loads custom sound files from the resource folder.
  15. NewMusic(...) - Loads custom music files from the resource folder.
  16. FreeFonts() - Frees up the font used from the process.
  17. FreeImages() - Frees up the image used from the process.
  18. FreeSounds() - Frees up the sound file used from the process.
  19. FreeMusic() - Frees up the music file used from the process.
  20. FreeResource() - Frees up the loaded assets from the process.

UtilityFunction.cs

  1. AddExplosion(...) - Adds the explosion animation at the given position.
  2. AddSplash(...) - Adds the splash animation at the given position.
  3. AddAnimation(...) - Adds a specified animation to a given position.
  4. UpdateAnimations() - Updates the animation that has been specified on a select tile.
  5. DrawAnimations() - Draws the animation that that had been specified on a select tile.
  6. DrawAnimationSequence() - Draws the the animation sequence that has been specified on a select tile.

AIPlayer.cs

  1. AIPlayer(...) - Initializes a new instance of the AIplayer class.

ISeaGrid.cs

  1. Width - Gets the width.
  2. Height - Gets the height.

Player.cs

  1. RandomizeDeployment() - Randomizes the deployment for the ships when initiated.
  2. Player(...) - Initializes a new instance of the Player class.
  3. IsDestroyed - Gets a value indicating whether all of the ships are destroyed.
  4. Hits - Gets the number of hits that the player has made.
  5. Score - Gets the player's score.
  6. GetEnumerator1() - Gets the enumerator.

Ship.cs

  1. Column - Gets the column location of the ship.
  2. Direction - Gets the direction of the ship.
  3. Ship(...) - Initializes a new instance of the Ship class.
  4. Hit() - Increases the hits taken counter if a shot hits the enemy's ship.
  5. IsDestroyed - Gets a value indicating whether a ship is destroyed.

AIHardPlayer.cs

  1. Target(...) - Initializes a new instance of the Target class.
  2. AIHardPlayer(...) - Initializes a new instance of the AIHardPlayer class.

AIMediumPlayer.cs

  1. AIMediumPlayer(...) - Initializes a new instance of the AIMediumPlayer class.