UNPKG

game-battleship

Version:
483 lines (124 loc) 5.53 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Class: Ship</title> <script src="scripts/prettify/prettify.js"> </script> <script src="scripts/prettify/lang-css.js"> </script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> </head> <body> <div id="main"> <h1 class="page-title">Class: Ship</h1> <section> <header> <h2><span class="attribs"><span class="type-signature"></span></span>Ship<span class="signature">(type, dimension, coordinates)</span><span class="type-signature"></span></h2> <div class="class-description">Ship</div> </header> <article> <div class="container-overview"> <h2>Constructor</h2> <h4 class="name" id="Ship"><span class="type-signature"></span>new Ship<span class="signature">(type, dimension, coordinates)</span><span class="type-signature"></span></h4> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>type</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">This defines the type of the ship "P" & "Q"</td> </tr> <tr> <td class="name"><code>dimension</code></td> <td class="type"> <span class="param-type">Array</span> </td> <td class="description last">Represnts the dimension of the ship</td> </tr> <tr> <td class="name"><code>coordinates</code></td> <td class="type"> <span class="param-type">Array</span> </td> <td class="description last">Represnts the coordinates of the ship</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="ship.js.html">ship.js</a>, <a href="ship.js.html#line11">line 11</a> </li></ul></dd> </dl> </div> <h3 class="subsection-title">Methods</h3> <h4 class="name" id="bombard"><span class="type-signature"></span>bombard<span class="signature">()</span><span class="type-signature"> &rarr; {null}</span></h4> <div class="description"> Function to bombard the ship </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="ship.js.html">ship.js</a>, <a href="ship.js.html#line38">line 38</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> returns nothing </div> <dl> <dt> Type </dt> <dd> <span class="param-type">null</span> </dd> </dl> <h4 class="name" id="isDestroyed"><span class="type-signature"></span>isDestroyed<span class="signature">()</span><span class="type-signature"> &rarr; {Boolean}</span></h4> <div class="description"> Function to check if the ship is destroyed </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="ship.js.html">ship.js</a>, <a href="ship.js.html#line30">line 30</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> returns true if ship is destroyed else false </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Boolean</span> </dd> </dl> </article> </section> </div> <nav> <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Area.html">Area</a></li><li><a href="Player.html">Player</a></li><li><a href="Ship.html">Ship</a></li></ul><h3>Global</h3><ul><li><a href="global.html#battle">battle</a></li><li><a href="global.html#fileReader">fileReader</a></li><li><a href="global.html#parseCoordinates">parseCoordinates</a></li><li><a href="global.html#validateArgs">validateArgs</a></li></ul> </nav> <br class="clear"> <footer> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Feb 19 2019 14:14:50 GMT+0530 (India Standard Time) </footer> <script> prettyPrint(); </script> <script src="scripts/linenumber.js"> </script> </body> </html>