You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1491 lines
16 KiB

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: TopLevelComponent</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: TopLevelComponent</h1>
<section>
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>TopLevelComponent<span class="signature">()</span><span class="type-signature"></span></h2>
<div class="class-description">Top-level component which manages the display of the entire game.</div>
</header>
<article>
<div class="container-overview">
<h2>Constructor</h2>
<h4 class="name" id="TopLevelComponent"><span class="type-signature"></span>new TopLevelComponent<span class="signature">()</span><span class="type-signature"></span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="components_TopLevel.component.js.html">components/TopLevel.component.js</a>, <a href="components_TopLevel.component.js.html#line88">line 88</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Extends</h3>
<ul>
<li>Component</li>
</ul>
<h3 class="subsection-title">Members</h3>
<h4 class="name" id="current_opponent_display"><span class="type-signature"></span>current_opponent_display<span class="type-signature"> :string</span></h4>
<div class="description">
The display name of the current opponent.
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">string</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="components_TopLevel.component.js.html">components/TopLevel.component.js</a>, <a href="components_TopLevel.component.js.html#line151">line 151</a>
</li></ul></dd>
</dl>
<h4 class="name" id="current_player_display"><span class="type-signature"></span>current_player_display<span class="type-signature"> :string</span></h4>
<div class="description">
The display name of the current player.
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">string</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="components_TopLevel.component.js.html">components/TopLevel.component.js</a>, <a href="components_TopLevel.component.js.html#line145">line 145</a>
</li></ul></dd>
</dl>
<h4 class="name" id="current_state"><span class="type-signature"></span>current_state<span class="type-signature"> :GameState|undefined</span></h4>
<div class="description">
The current game state.
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">GameState</span>
|
<span class="param-type">undefined</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="components_TopLevel.component.js.html">components/TopLevel.component.js</a>, <a href="components_TopLevel.component.js.html#line103">line 103</a>
</li></ul></dd>
</dl>
<h4 class="name" id="GameState"><span class="type-signature"></span>GameState<span class="type-signature"> :object</span></h4>
<div class="description">
Make the game state accessible w/in the template.
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">object</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="components_TopLevel.component.js.html">components/TopLevel.component.js</a>, <a href="components_TopLevel.component.js.html#line97">line 97</a>
</li></ul></dd>
</dl>
<h4 class="name" id="instructions"><span class="type-signature"></span>instructions<span class="type-signature"> :string</span></h4>
<div class="description">
The current instructions to be shown to the user.
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">string</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="components_TopLevel.component.js.html">components/TopLevel.component.js</a>, <a href="components_TopLevel.component.js.html#line121">line 121</a>
</li></ul></dd>
</dl>
<h4 class="name" id="opponent_rows"><span class="type-signature"></span>opponent_rows<span class="type-signature"> :Array.&lt;Array.&lt;object>></span></h4>
<div class="description">
The opponent's grid data.
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Array.&lt;Array.&lt;object>></span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="components_TopLevel.component.js.html">components/TopLevel.component.js</a>, <a href="components_TopLevel.component.js.html#line109">line 109</a>
</li></ul></dd>
</dl>
<h4 class="name" id="player_is_firing_missiles"><span class="type-signature"></span>player_is_firing_missiles<span class="type-signature"> :boolean</span></h4>
<div class="description">
True if the player should be able to fire missiles at their opponent.
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">boolean</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="components_TopLevel.component.js.html">components/TopLevel.component.js</a>, <a href="components_TopLevel.component.js.html#line133">line 133</a>
</li></ul></dd>
</dl>
<h4 class="name" id="player_is_placing_ships"><span class="type-signature"></span>player_is_placing_ships<span class="type-signature"> :boolean</span></h4>
<div class="description">
True if the player should be able to place their ships.
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">boolean</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="components_TopLevel.component.js.html">components/TopLevel.component.js</a>, <a href="components_TopLevel.component.js.html#line127">line 127</a>
</li></ul></dd>
</dl>
<h4 class="name" id="player_rows"><span class="type-signature"></span>player_rows<span class="type-signature"> :Array.&lt;Array.&lt;object>></span></h4>
<div class="description">
The player's grid data.
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Array.&lt;Array.&lt;object>></span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="components_TopLevel.component.js.html">components/TopLevel.component.js</a>, <a href="components_TopLevel.component.js.html#line115">line 115</a>
</li></ul></dd>
</dl>
<h4 class="name" id="ships_to_place"><span class="type-signature"></span>ships_to_place<span class="type-signature"> :Array.&lt;ShipType></span></h4>
<div class="description">
If in placement mode, the ships that are yet to be placed.
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Array.&lt;ShipType></span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="components_TopLevel.component.js.html">components/TopLevel.component.js</a>, <a href="components_TopLevel.component.js.html#line139">line 139</a>
</li></ul></dd>
</dl>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="confirm_player_change"><span class="type-signature"></span>confirm_player_change<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Called when the player has confirmed the player change.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="components_TopLevel.component.js.html">components/TopLevel.component.js</a>, <a href="components_TopLevel.component.js.html#line227">line 227</a>
</li></ul></dd>
</dl>
<h4 class="name" id="on_missile_fired"><span class="type-signature">(async) </span>on_missile_fired<span class="signature">(row_index, column_index)</span><span class="type-signature"></span></h4>
<div class="description">
Called when the player attempts to fire a missile.
</div>
<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>row_index</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>column_index</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="components_TopLevel.component.js.html">components/TopLevel.component.js</a>, <a href="components_TopLevel.component.js.html#line209">line 209</a>
</li></ul></dd>
</dl>
<h4 class="name" id="on_ship_placed"><span class="type-signature"></span>on_ship_placed<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Called when the current user has placed a ship.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="components_TopLevel.component.js.html">components/TopLevel.component.js</a>, <a href="components_TopLevel.component.js.html#line196">line 196</a>
</li></ul></dd>
</dl>
<h4 class="name" id="ship"><span class="type-signature"></span>ship<span class="signature">(n)</span><span class="type-signature"></span></h4>
<div class="description">
Set the number of boats.
</div>
<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>n</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="components_TopLevel.component.js.html">components/TopLevel.component.js</a>, <a href="components_TopLevel.component.js.html#line188">line 188</a>
</li></ul></dd>
</dl>
<h4 class="name" id="vue_on_create"><span class="type-signature">(async) </span>vue_on_create<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;void>}</span></h4>
<div class="description">
Called when the component is initialized.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="components_TopLevel.component.js.html">components/TopLevel.component.js</a>, <a href="components_TopLevel.component.js.html#line157">line 157</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.&lt;void></span>
</dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-errors.html">errors</a></li><li><a href="module-lang.html">lang</a></li><li><a href="module-sounds.html">sounds</a></li><li><a href="module-util.html">util</a></li></ul><h3>Classes</h3><ul><li><a href="GameBoardComponent.html">GameBoardComponent</a></li><li><a href="GameStateService.html">GameStateService</a></li><li><a href="GridCellComponent.html">GridCellComponent</a></li><li><a href="module-errors.InvalidAdvanceStateError.html">InvalidAdvanceStateError</a></li><li><a href="module-errors.InvalidMissileFireAttemptError.html">InvalidMissileFireAttemptError</a></li><li><a href="module-errors.InvalidShipPlacementError.html">InvalidShipPlacementError</a></li><li><a href="module-sounds-Sound.html">Sound</a></li><li><a href="ScoreBoardComponent.html">ScoreBoardComponent</a></li><li><a href="TopLevelComponent.html">TopLevelComponent</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.5</a> on Sat Sep 12 2020 16:40:09 GMT-0500 (Central Daylight Time)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>