Commit d7cb50a1 authored by Carl Johan Gützkow's avatar Carl Johan Gützkow 🎮
Browse files

Merge branch 'feat/gui-change-army' into 'master'

feat: add editing page for creating new and editing existing army

Closes #20

See merge request !30
parents 44b8f39d 3961eabd
Pipeline #183769 passed with stages
in 45 seconds
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Sun May 01 19:43:43 CEST 2022 -->
<!-- Generated by javadoc (17) on Mon May 16 20:01:56 CEST 2022 -->
<title>All Classes and Interfaces</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="dc.created" content="2022-05-01">
<meta name="dc.created" content="2022-05-16">
<meta name="description" content="class index">
<meta name="generator" content="javadoc/AllClassesIndexWriter">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
......@@ -36,6 +36,7 @@ loadScripts(document, 'script');</script>
<li>Package</li>
<li>Class</li>
<li><a href="overview-tree.html">Tree</a></li>
<li><a href="deprecated-list.html">Deprecated</a></li>
<li><a href="index-files/index-1.html">Index</a></li>
<li><a href="help-doc.html#all-classes">Help</a></li>
</ul>
......@@ -81,7 +82,7 @@ loadScripts(document, 'script');</script>
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="edu.ntnu.idatt2001.carljgu.client/edu/ntnu/idatt2001/carljgu/client/BattleController.html" title="class in edu.ntnu.idatt2001.carljgu.client">BattleController</a></div>
<div class="col-last even-row-color all-classes-table all-classes-table-tab2">
<div class="block">A controller class which
handles events in the fxml file.</div>
handles events in the fxml file battle-armies.fxml.</div>
</div>
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="edu.ntnu.idatt2001.carljgu.client/edu/ntnu/idatt2001/carljgu/units/specialized/CavalryUnit.html" title="class in edu.ntnu.idatt2001.carljgu.units.specialized">CavalryUnit</a></div>
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2">
......@@ -98,45 +99,54 @@ loadScripts(document, 'script');</script>
</div>
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="edu.ntnu.idatt2001.carljgu.client/edu/ntnu/idatt2001/carljgu/client/dialogs/DialogBoxBuilder.html" title="class in edu.ntnu.idatt2001.carljgu.client.dialogs">DialogBoxBuilder</a></div>
<div class="col-last even-row-color all-classes-table all-classes-table-tab2">
<div class="block">A builder class which simplifies the
DialogBox class.</div>
<div class="block">A builder class which simplifies the process of
building a DialogBox object.</div>
</div>
<div class="col-first odd-row-color all-classes-table all-classes-table-tab5"><a href="edu.ntnu.idatt2001.carljgu.client/edu/ntnu/idatt2001/carljgu/FileExtensionException.html" title="class in edu.ntnu.idatt2001.carljgu">FileExtensionException</a></div>
<div class="col-last odd-row-color all-classes-table all-classes-table-tab5">
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="edu.ntnu.idatt2001.carljgu.client/edu/ntnu/idatt2001/carljgu/client/EditArmyController.html" title="class in edu.ntnu.idatt2001.carljgu.client">EditArmyController</a></div>
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2">
<div class="block">A controller class which
handles events in the fxml file edit-army.fxml.</div>
</div>
<div class="col-first even-row-color all-classes-table all-classes-table-tab5"><a href="edu.ntnu.idatt2001.carljgu.client/edu/ntnu/idatt2001/carljgu/FileExtensionException.html" title="class in edu.ntnu.idatt2001.carljgu">FileExtensionException</a></div>
<div class="col-last even-row-color all-classes-table all-classes-table-tab5">
<div class="block">Thrown if an extension of a file is invalid
The exception thrown needs to have a message</div>
</div>
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="edu.ntnu.idatt2001.carljgu.client/edu/ntnu/idatt2001/carljgu/units/specialized/InfantryUnit.html" title="class in edu.ntnu.idatt2001.carljgu.units.specialized">InfantryUnit</a></div>
<div class="col-last even-row-color all-classes-table all-classes-table-tab2">
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="edu.ntnu.idatt2001.carljgu.client/edu/ntnu/idatt2001/carljgu/units/specialized/InfantryUnit.html" title="class in edu.ntnu.idatt2001.carljgu.units.specialized">InfantryUnit</a></div>
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2">
<div class="block">Class InfantryUnit that inherits from Unit.</div>
</div>
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="edu.ntnu.idatt2001.carljgu.client/edu/ntnu/idatt2001/carljgu/client/Main.html" title="class in edu.ntnu.idatt2001.carljgu.client">Main</a></div>
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2">
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="edu.ntnu.idatt2001.carljgu.client/edu/ntnu/idatt2001/carljgu/client/Main.html" title="class in edu.ntnu.idatt2001.carljgu.client">Main</a></div>
<div class="col-last even-row-color all-classes-table all-classes-table-tab2">
<div class="block">The main class that is run when the application
is called upon.</div>
</div>
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="edu.ntnu.idatt2001.carljgu.client/edu/ntnu/idatt2001/carljgu/units/specialized/RangedUnit.html" title="class in edu.ntnu.idatt2001.carljgu.units.specialized">RangedUnit</a></div>
<div class="col-last even-row-color all-classes-table all-classes-table-tab2">
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="edu.ntnu.idatt2001.carljgu.client/edu/ntnu/idatt2001/carljgu/units/specialized/RangedUnit.html" title="class in edu.ntnu.idatt2001.carljgu.units.specialized">RangedUnit</a></div>
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2">
<div class="block">Class RangedUnit that inherits from Unit.</div>
</div>
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="edu.ntnu.idatt2001.carljgu.client/edu/ntnu/idatt2001/carljgu/battle/SimulationAttack.html" title="class in edu.ntnu.idatt2001.carljgu.battle">SimulationAttack</a></div>
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2">
<div class="block">A class for keeping track of which unit
has attacked which unit.</div>
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="edu.ntnu.idatt2001.carljgu.client/edu/ntnu/idatt2001/carljgu/battle/SimulationAttack.html" title="class in edu.ntnu.idatt2001.carljgu.battle">SimulationAttack</a></div>
<div class="col-last even-row-color all-classes-table all-classes-table-tab2">Deprecated.
<div class="deprecation-comment">06.05.2022</div>
</div>
<div class="col-first even-row-color all-classes-table all-classes-table-tab3"><a href="edu.ntnu.idatt2001.carljgu.client/edu/ntnu/idatt2001/carljgu/Terrain.html" title="enum class in edu.ntnu.idatt2001.carljgu">Terrain</a></div>
<div class="col-last even-row-color all-classes-table all-classes-table-tab3">
<div class="block">En enum that represents the different terrain
<div class="col-first odd-row-color all-classes-table all-classes-table-tab3"><a href="edu.ntnu.idatt2001.carljgu.client/edu/ntnu/idatt2001/carljgu/Terrain.html" title="enum class in edu.ntnu.idatt2001.carljgu">Terrain</a></div>
<div class="col-last odd-row-color all-classes-table all-classes-table-tab3">
<div class="block">An enum that represents the different terrains
that the battles can occur on.</div>
</div>
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="edu.ntnu.idatt2001.carljgu.client/edu/ntnu/idatt2001/carljgu/units/Unit.html" title="class in edu.ntnu.idatt2001.carljgu.units">Unit</a></div>
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2">
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="edu.ntnu.idatt2001.carljgu.client/edu/ntnu/idatt2001/carljgu/units/Unit.html" title="class in edu.ntnu.idatt2001.carljgu.units">Unit</a></div>
<div class="col-last even-row-color all-classes-table all-classes-table-tab2">
<div class="block">The abstract class Unit.</div>
</div>
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="edu.ntnu.idatt2001.carljgu.client/edu/ntnu/idatt2001/carljgu/units/UnitFactory.html" title="class in edu.ntnu.idatt2001.carljgu.units">UnitFactory</a></div>
<div class="col-last even-row-color all-classes-table all-classes-table-tab2">
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="edu.ntnu.idatt2001.carljgu.client/edu/ntnu/idatt2001/carljgu/units/UnitFactory.html" title="class in edu.ntnu.idatt2001.carljgu.units">UnitFactory</a></div>
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2">
<div class="block">A class to simply and elegantly create units.</div>
</div>
<div class="col-first even-row-color all-classes-table all-classes-table-tab3"><a href="edu.ntnu.idatt2001.carljgu.client/edu/ntnu/idatt2001/carljgu/units/UnitType.html" title="enum class in edu.ntnu.idatt2001.carljgu.units">UnitType</a></div>
<div class="col-last even-row-color all-classes-table all-classes-table-tab3">
<div class="block">An enum that represents the different unit types
that an army can contain.</div>
</div>
</div>
</div>
</div>
......
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Sun May 01 19:43:43 CEST 2022 -->
<!-- Generated by javadoc (17) on Mon May 16 20:01:56 CEST 2022 -->
<title>All Packages</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="dc.created" content="2022-05-01">
<meta name="dc.created" content="2022-05-16">
<meta name="description" content="package index">
<meta name="generator" content="javadoc/AllPackagesIndexWriter">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
......@@ -32,6 +32,7 @@ loadScripts(document, 'script');</script>
<li>Package</li>
<li>Class</li>
<li><a href="overview-tree.html">Tree</a></li>
<li><a href="deprecated-list.html">Deprecated</a></li>
<li><a href="index-files/index-1.html">Index</a></li>
<li><a href="help-doc.html#all-packages">Help</a></li>
</ul>
......
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Sun May 01 19:43:43 CEST 2022 -->
<!-- Generated by javadoc (17) on Mon May 16 20:01:56 CEST 2022 -->
<title>Constant Field Values</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="dc.created" content="2022-05-01">
<meta name="dc.created" content="2022-05-16">
<meta name="description" content="summary of constants">
<meta name="generator" content="javadoc/ConstantsSummaryWriterImpl">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
......@@ -32,6 +32,7 @@ loadScripts(document, 'script');</script>
<li>Package</li>
<li>Class</li>
<li><a href="overview-tree.html">Tree</a></li>
<li><a href="deprecated-list.html">Deprecated</a></li>
<li><a href="index-files/index-1.html">Index</a></li>
<li><a href="help-doc.html#constant-values">Help</a></li>
</ul>
......
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Mon May 16 20:01:56 CEST 2022 -->
<title>Deprecated List</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="dc.created" content="2022-05-16">
<meta name="description" content="deprecated elements">
<meta name="generator" content="javadoc/DeprecatedListWriter">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="script-dir/jquery-ui.min.css" title="Style">
<link rel="stylesheet" type="text/css" href="jquery-ui.overrides.css" title="Style">
<script type="text/javascript" src="script.js"></script>
<script type="text/javascript" src="script-dir/jquery-3.5.1.min.js"></script>
<script type="text/javascript" src="script-dir/jquery-ui.min.js"></script>
</head>
<body class="deprecated-list-page">
<script type="text/javascript">var pathtoroot = "./";
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="flex-box">
<header role="banner" class="flex-header">
<nav role="navigation">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="top-nav" id="navbar-top">
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
<li><a href="edu.ntnu.idatt2001.carljgu.client/module-summary.html">Module</a></li>
<li>Package</li>
<li>Class</li>
<li><a href="overview-tree.html">Tree</a></li>
<li class="nav-bar-cell1-rev">Deprecated</li>
<li><a href="index-files/index-1.html">Index</a></li>
<li><a href="help-doc.html#deprecated">Help</a></li>
</ul>
</div>
<div class="sub-nav">
<div class="nav-list-search"><label for="search-input">SEARCH:</label>
<input type="text" id="search-input" value="search" disabled="disabled">
<input type="reset" id="reset-button" value="reset" disabled="disabled">
</div>
</div>
<!-- ========= END OF TOP NAVBAR ========= -->
<span class="skip-nav" id="skip-navbar-top"></span></nav>
</header>
<div class="flex-content">
<main role="main">
<div class="header">
<h1 title="Deprecated API" class="title">Deprecated API</h1>
<h2 title="Contents">Contents</h2>
<ul>
<li><a href="#class">Classes</a></li>
</ul>
</div>
<ul class="block-list">
<li>
<div id="class">
<div class="caption"><span>Deprecated Classes</span></div>
<div class="summary-table two-column-summary">
<div class="table-header col-first">Class</div>
<div class="table-header col-last">Description</div>
<div class="col-summary-item-name even-row-color"><a href="edu.ntnu.idatt2001.carljgu.client/edu/ntnu/idatt2001/carljgu/battle/SimulationAttack.html" title="class in edu.ntnu.idatt2001.carljgu.battle">edu.ntnu.idatt2001.carljgu.battle.SimulationAttack</a></div>
<div class="col-last even-row-color">
<div class="deprecation-comment">06.05.2022</div>
</div>
</div>
</div>
</li>
</ul>
</main>
</div>
</div>
</body>
</html>
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Sun May 01 19:43:43 CEST 2022 -->
<!-- Generated by javadoc (17) on Mon May 16 20:01:56 CEST 2022 -->
<title>ArmyFileHandler</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="dc.created" content="2022-05-01">
<meta name="dc.created" content="2022-05-16">
<meta name="description" content="declaration: module: edu.ntnu.idatt2001.carljgu.client, package: edu.ntnu.idatt2001.carljgu, class: ArmyFileHandler">
<meta name="generator" content="javadoc/ClassWriterImpl">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
......@@ -36,6 +36,7 @@ loadScripts(document, 'script');</script>
<li><a href="package-summary.html">Package</a></li>
<li class="nav-bar-cell1-rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../help-doc.html#class">Help</a></li>
</ul>
......@@ -117,7 +118,7 @@ loadScripts(document, 'script');</script>
<div class="table-header col-second">Method</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getFilePath()" class="member-name-link">getFilePath</a>()</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getFilePath(java.lang.String)" class="member-name-link">getFilePath</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;fileChooserType)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Uses the system default file explorer to get
a file path of the user's choice.</div>
......@@ -234,14 +235,17 @@ loadScripts(document, 'script');</script>
</section>
</li>
<li>
<section class="detail" id="getFilePath()">
<section class="detail" id="getFilePath(java.lang.String)">
<h3>getFilePath</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span>&nbsp;<span class="element-name">getFilePath</span>()</div>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span>&nbsp;<span class="element-name">getFilePath</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;fileChooserType)</span></div>
<div class="block">Uses the system default file explorer to get
a file path of the user's choice.
If a user closes the file chooser,
null is returned.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>fileChooserType</code> - String - OPEN or SAVE depending on whether
the user wants to open a file or write to a file</dd>
<dt>Returns:</dt>
<dd>filePath - String - the file path of a csv file for an army</dd>
</dl>
......
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Sun May 01 19:43:43 CEST 2022 -->
<!-- Generated by javadoc (17) on Mon May 16 20:01:56 CEST 2022 -->
<title>FileExtensionException</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="dc.created" content="2022-05-01">
<meta name="dc.created" content="2022-05-16">
<meta name="description" content="declaration: module: edu.ntnu.idatt2001.carljgu.client, package: edu.ntnu.idatt2001.carljgu, class: FileExtensionException">
<meta name="generator" content="javadoc/ClassWriterImpl">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
......@@ -32,6 +32,7 @@ loadScripts(document, 'script');</script>
<li><a href="package-summary.html">Package</a></li>
<li class="nav-bar-cell1-rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../help-doc.html#class">Help</a></li>
</ul>
......
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Sun May 01 19:43:43 CEST 2022 -->
<!-- Generated by javadoc (17) on Mon May 16 20:01:56 CEST 2022 -->
<title>Terrain</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="dc.created" content="2022-05-01">
<meta name="dc.created" content="2022-05-16">
<meta name="description" content="declaration: module: edu.ntnu.idatt2001.carljgu.client, package: edu.ntnu.idatt2001.carljgu, enum: Terrain">
<meta name="generator" content="javadoc/ClassWriterImpl">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
......@@ -36,6 +36,7 @@ loadScripts(document, 'script');</script>
<li><a href="package-summary.html">Package</a></li>
<li class="nav-bar-cell1-rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../help-doc.html#class">Help</a></li>
</ul>
......@@ -85,11 +86,11 @@ loadScripts(document, 'script');</script>
<hr>
<div class="type-signature"><span class="modifiers">public enum </span><span class="element-name type-name-label">Terrain</span>
<span class="extends-implements">extends <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Enum.html" title="class or interface in java.lang" class="external-link">Enum</a>&lt;<a href="Terrain.html" title="enum class in edu.ntnu.idatt2001.carljgu">Terrain</a>&gt;</span></div>
<div class="block">En enum that represents the different terrain
<div class="block">An enum that represents the different terrains
that the battles can occur on.</div>
<dl class="notes">
<dt>Version:</dt>
<dd>1.1 09.04.2022</dd>
<dd>1.2 15.05.2022</dd>
<dt>Author:</dt>
<dd>Carl Gützkow</dd>
</dl>
......@@ -115,7 +116,7 @@ loadScripts(document, 'script');</script>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color"><code><a href="#FOREST" class="member-name-link">FOREST</a></code></div>
<div class="col-last even-row-color">&nbsp;</div>
<div class="col-first odd-row-color"><code><a href="#HILL" class="member-name-link">HILL</a></code></div>
<div class="col-first odd-row-color"><code><a href="#HILLS" class="member-name-link">HILLS</a></code></div>
<div class="col-last odd-row-color">&nbsp;</div>
<div class="col-first even-row-color"><code><a href="#PLAINS" class="member-name-link">PLAINS</a></code></div>
<div class="col-last even-row-color">&nbsp;</div>
......@@ -127,12 +128,22 @@ loadScripts(document, 'script');</script>
<section class="method-summary" id="method-summary">
<h2>Method Summary</h2>
<div id="method-summary-table">
<div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab1" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab1', 3)" class="table-tab">Static Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div>
<div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab1" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab1', 3)" class="table-tab">Static Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div>
<div id="method-summary-table.tabpanel" role="tabpanel">
<div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0">
<div class="table-header col-first">Modifier and Type</div>
<div class="table-header col-second">Method</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getReadableName()" class="member-name-link">getReadableName</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Gets the name from the enum</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="Terrain.html" title="enum class in edu.ntnu.idatt2001.carljgu">Terrain</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#getTerrain(java.lang.String)" class="member-name-link">getTerrain</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;readableName)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Gets a Terrain enum from a string.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="Terrain.html" title="enum class in edu.ntnu.idatt2001.carljgu">Terrain</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#valueOf(java.lang.String)" class="member-name-link">valueOf</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;name)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
......@@ -165,12 +176,6 @@ the order they are declared.</div>
<h2>Enum Constant Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="HILL">
<h3>HILL</h3>
<div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<span class="return-type"><a href="Terrain.html" title="enum class in edu.ntnu.idatt2001.carljgu">Terrain</a></span>&nbsp;<span class="element-name">HILL</span></div>
</section>
</li>
<li>
<section class="detail" id="PLAINS">
<h3>PLAINS</h3>
<div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<span class="return-type"><a href="Terrain.html" title="enum class in edu.ntnu.idatt2001.carljgu">Terrain</a></span>&nbsp;<span class="element-name">PLAINS</span></div>
......@@ -182,6 +187,12 @@ the order they are declared.</div>
<div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<span class="return-type"><a href="Terrain.html" title="enum class in edu.ntnu.idatt2001.carljgu">Terrain</a></span>&nbsp;<span class="element-name">FOREST</span></div>
</section>
</li>
<li>
<section class="detail" id="HILLS">
<h3>HILLS</h3>
<div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<span class="return-type"><a href="Terrain.html" title="enum class in edu.ntnu.idatt2001.carljgu">Terrain</a></span>&nbsp;<span class="element-name">HILLS</span></div>
</section>
</li>
</ul>
</section>
</li>
......@@ -221,6 +232,31 @@ not permitted.)</div>
</dl>
</section>
</li>
<li>
<section class="detail" id="getReadableName()">
<h3>getReadableName</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span>&nbsp;<span class="element-name">getReadableName</span>()</div>
<div class="block">Gets the name from the enum</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>readableName - String - enum in PascalCase</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getTerrain(java.lang.String)">
<h3>getTerrain</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="Terrain.html" title="enum class in edu.ntnu.idatt2001.carljgu">Terrain</a></span>&nbsp;<span class="element-name">getTerrain</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;readableName)</span></div>
<div class="block">Gets a Terrain enum from a string.
If a terrain was not found, null is returned instead.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>readableName</code> - String - the enum in PascalCase</dd>
<dt>Returns:</dt>
<dd>UnitType - the enum respective to the readable name</dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
......
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Sun May 01 19:43:43 CEST 2022 -->
<!-- Generated by javadoc (17) on Mon May 16 20:01:56 CEST 2022 -->
<title>Battle</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="dc.created" content="2022-05-01">
<meta name="dc.created" content="2022-05-16">
<meta name="description" content="declaration: module: edu.ntnu.idatt2001.carljgu.client, package: edu.ntnu.idatt2001.carljgu.battle, class: Battle">
<meta name="generator" content="javadoc/ClassWriterImpl">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
......@@ -36,6 +36,7 @@ loadScripts(document, 'script');</script>
<li><a href="package-summary.html">Package</a></li>
<li class="nav-bar-cell1-rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../../help-doc.html#class">Help</a></li>
</ul>
......@@ -82,7 +83,7 @@ loadScripts(document, 'script');</script>
<div class="block">Class Battle that simulates a battle between two armies.</div>
<dl class="notes">
<dt>Version:</dt>
<dd>1.3 30.04.2022</dd>
<dd>1.4 01.05.2022</dd>
<dt>Author:</dt>
<dd>Carl Gützkow</dd>
</dl>
......@@ -117,33 +118,46 @@ loadScripts(document, 'script');</script>
<div class="table-header col-first">Modifier and Type</div>
<div class="table-header col-second">Method</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/ArrayList.html" title="class or interface in java.util" class="external-link">ArrayList</a>&lt;<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&gt;</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getAttackLog()" class="member-name-link">getAttackLog</a>()</code></div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#attackStringRepresentation(int,edu.ntnu.idatt2001.carljgu.units.Unit,edu.ntnu.idatt2001.carljgu.units.Unit,edu.ntnu.idatt2001.carljgu.units.Army,edu.ntnu.idatt2001.carljgu.units.Army)" class="member-name-link">attackStringRepresentation</a><wbr>(int&nbsp;damageDealt,
<a href="../units/Unit.html" title="class in edu.ntnu.idatt2001.carljgu.units">Unit</a>&nbsp;attacker,
<a href="../units/Unit.html" title="class in edu.ntnu.idatt2001.carljgu.units">Unit</a>&nbsp;defender,
<a href="../units/Army.html" title="class in edu.ntnu.idatt2001.carljgu.units">Army</a>&nbsp;attackingArmy,
<a href="../units/Army.html" title="class in edu.ntnu.idatt2001.carljgu.units">Army</a>&nbsp;defendingArmy)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Information displayed is the
name of the attacking and defending army,
unit information like name and class
as well as how much damage was outputted
from the attack.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/ArrayList.html" title="class or interface in java.util" class="external-link">ArrayList</a>&lt;<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&gt;</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getAttackLog()" class="member-name-link">getAttackLog</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns the log of attacks
to easily hold the information
about each attack.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="../Terrain.html" title="enum class in edu.ntnu.idatt2001.carljgu">Terrain</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getTerrain()" class="member-name-link">getTerrain</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="../Terrain.html" title="enum class in edu.ntnu.idatt2001.carljgu">Terrain</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getTerrain()" class="member-name-link">getTerrain</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Gets the terrain where
the battle occurs.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="../units/Army.html" title="class in edu.ntnu.idatt2001.carljgu.units">Army</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getWinner()" class="member-name-link">getWinner</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="../units/Army.html" title="class in edu.ntnu.idatt2001.carljgu.units">Army</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getWinner()" class="member-name-link">getWinner</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Gets the winner of the army
or a null object</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="../units/Army.html" title="class in edu.ntnu.idatt2001.carljgu.units">Army</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#simulate()" class="member-name-link">simulate</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="../units/Army.html" title="class in edu.ntnu.idatt2001.carljgu.units">Army</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#simulate()" class="member-name-link">simulate</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Simulate a battle.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#toString()" class="member-name-link">toString</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#toString()" class="member-name-link">toString</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Overrides toString() method from Object.</div>
</div>
</div>
......@@ -169,7 +183,8 @@ loadScripts(document, 'script');</script>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">Battle</span><wbr><span class="parameters">(<a href="../units/Army.html" title="class in edu.ntnu.idatt2001.carljgu.units">Army</a>&nbsp;armyOne,
<a href="../units/Army.html" title="class in edu.ntnu.idatt2001.carljgu.units">Army</a>&nbsp;armyTwo,
<a href="../Terrain.html" title="enum class in edu.ntnu.idatt2001.carljgu">Terrain</a>&nbsp;terrain)</span>
throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">IllegalArgumentException</a></span></div>
throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">IllegalArgumentException</a>,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/NullPointerException.html" title="class or interface in java.lang" class="external-link">NullPointerException</a></span></div>
<div class="block">Instantiates a new Battle.</div>
<dl class="notes">
<dt>Parameters:</dt>
......@@ -177,8 +192,7 @@ loadScripts(document, 'script');</script>
<dd><code>armyTwo</code> - Army - the second army</dd>
<dd><code>terrain</code> - Terrain - on what terrain the battle is fought on.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">IllegalArgumentException</a></code> - thrown if one of the armies are empty,
if armies are equal or if terrain is not defined</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">IllegalArgumentException</a></code> - thrown if one of the armies are empty, if armies are equal or if terrain is not defined</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/NullPointerException.html" title="class or interface in java.lang" class="external-link">NullPointerException</a></code> - thrown if one of the armies are null object</dd>
</dl>
</section>
......@@ -212,8 +226,7 @@ loadScripts(document, 'script');</script>
about each attack.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>attackLog - ArrayList - a list of all the attacks
performed in the simulation.</dd>
<dd>attackLog - ArrayList - a list of all the attacks performed in the simulation.</dd>
</dl>
</section>
</li>
......@@ -253,10 +266,62 @@ loadScripts(document, 'script');</script>
</section>
</li>
<li>
<section class="detail" id="attackStringRepresentation(int,edu.ntnu.idatt2001.carljgu.units.Unit,edu.ntnu.idatt2001.carljgu.units.Unit,edu.ntnu.idatt2001.carljgu.units.Army,edu.ntnu.idatt2001.carljgu.units.Army)">
<h3>attackStringRepresentation</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span>&nbsp;<span class="element-name">attackStringRepresentation</span><wbr><span class="parameters">(int&nbsp;damageDealt,
<a href="../units/Unit.html" title="class in edu.ntnu.idatt2001.carljgu.units">Unit</a>&nbsp;attacker,
<a href="../units/Unit.html" title="class in edu.ntnu.idatt2001.carljgu.units">Unit</a>&nbsp;defender,
<a href="../units/Army.html" title="class in edu.ntnu.idatt2001.carljgu.units">Army</a>&nbsp;attackingArmy,
<a href="../units/Army.html" title="class in edu.ntnu.idatt2001.carljgu.units">Army</a>&nbsp;defendingArmy)</span></div>
<div class="block">Information displayed is the
name of the attacking and defending army,
unit information like name and class