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

Merge branch 'enhance/better-simulation' into 'master'

enhance: simulation step can include an attack from both armies

Closes #24

See merge request !34
parents f6d5609d 45f6b52f
Pipeline #183798 passed with stages
in 45 seconds
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Mon May 16 21:38:10 CEST 2022 -->
<!-- Generated by javadoc (17) on Wed May 18 17:57:50 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-16">
<meta name="dc.created" content="2022-05-18">
<meta name="description" content="class index">
<meta name="generator" content="javadoc/AllClassesIndexWriter">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
......@@ -127,7 +127,7 @@ 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/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 class="deprecation-comment">Provided no extra functionality and made the program harder to read.</div>
</div>
<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/battle/Terrain.html" title="enum class in edu.ntnu.idatt2001.carljgu.battle">Terrain</a></div>
<div class="col-last odd-row-color all-classes-table all-classes-table-tab3">
......
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Mon May 16 21:38:10 CEST 2022 -->
<!-- Generated by javadoc (17) on Wed May 18 17:57:50 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-16">
<meta name="dc.created" content="2022-05-18">
<meta name="description" content="package index">
<meta name="generator" content="javadoc/AllPackagesIndexWriter">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
......
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Mon May 16 21:38:10 CEST 2022 -->
<!-- Generated by javadoc (17) on Wed May 18 17:57:50 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-16">
<meta name="dc.created" content="2022-05-18">
<meta name="description" content="summary of constants">
<meta name="generator" content="javadoc/ConstantsSummaryWriterImpl">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
......
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Mon May 16 21:38:10 CEST 2022 -->
<!-- Generated by javadoc (17) on Wed May 18 17:57:50 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="dc.created" content="2022-05-18">
<meta name="description" content="deprecated elements">
<meta name="generator" content="javadoc/DeprecatedListWriter">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
......@@ -64,7 +64,8 @@ loadScripts(document, 'script');</script>
<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 class="deprecation-comment">Provided no extra functionality and made the program harder to read.
Additionally, it had high unnecessary coupling with Army and Unit. 06.05.2022</div>
</div>
</div>
</div>
......
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Mon May 16 21:38:10 CEST 2022 -->
<!-- Generated by javadoc (17) on Wed May 18 17:57:50 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-16">
<meta name="dc.created" content="2022-05-18">
<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">
......
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Mon May 16 21:38:10 CEST 2022 -->
<!-- Generated by javadoc (17) on Wed May 18 17:57:50 CEST 2022 -->
<title>Army</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="dc.created" content="2022-05-18">
<meta name="description" content="declaration: module: edu.ntnu.idatt2001.carljgu.client, package: edu.ntnu.idatt2001.carljgu.army, class: Army">
<meta name="generator" content="javadoc/ClassWriterImpl">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
......@@ -85,7 +85,7 @@ loadScripts(document, 'script');</script>
meant to fight another army.</div>
<dl class="notes">
<dt>Version:</dt>
<dd>1.2 14.05.2022</dd>
<dd>1.3 17.05.2022</dd>
<dt>Author:</dt>
<dd>Carl Gützkow</dd>
</dl>
......@@ -398,7 +398,7 @@ loadScripts(document, 'script');</script>
If there are no units it returns a null object.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>unit - Unit - an instance of Unit.</dd>
<dd>Unit - an instance of Unit.</dd>
</dl>
</section>
</li>
......
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Mon May 16 21:38:10 CEST 2022 -->
<!-- Generated by javadoc (17) on Wed May 18 17:57:50 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-16">
<meta name="dc.created" content="2022-05-18">
<meta name="description" content="declaration: module: edu.ntnu.idatt2001.carljgu.client, package: edu.ntnu.idatt2001.carljgu.army, class: ArmyFileHandler">
<meta name="generator" content="javadoc/ClassWriterImpl">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
......@@ -101,7 +101,8 @@ loadScripts(document, 'script');</script>
<div class="table-header col-last">Description</div>
<div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E()" class="member-name-link">ArmyFileHandler</a>()</code></div>
<div class="col-last even-row-color">
<div class="block">Constructor which initiates the readLinesSkipped arraylist</div>
<div class="block">Constructor which initiates the readLinesSkipped arraylist
Sets the delimiter to a comma for comma seperated value.</div>
</div>
</div>
</section>
......@@ -162,7 +163,8 @@ loadScripts(document, 'script');</script>
<section class="detail" id="&lt;init&gt;()">
<h3>ArmyFileHandler</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">ArmyFileHandler</span>()</div>
<div class="block">Constructor which initiates the readLinesSkipped arraylist</div>
<div class="block">Constructor which initiates the readLinesSkipped arraylist
Sets the delimiter to a comma for comma seperated value.</div>
</section>
</li>
</ul>
......
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Mon May 16 21:38:10 CEST 2022 -->
<!-- Generated by javadoc (17) on Wed May 18 17:57:50 CEST 2022 -->
<title>edu.ntnu.idatt2001.carljgu.army</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="dc.created" content="2022-05-18">
<meta name="description" content="declaration: module: edu.ntnu.idatt2001.carljgu.client, package: edu.ntnu.idatt2001.carljgu.army">
<meta name="generator" content="javadoc/PackageWriterImpl">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
......
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Mon May 16 21:38:10 CEST 2022 -->
<!-- Generated by javadoc (17) on Wed May 18 17:57:50 CEST 2022 -->
<title>edu.ntnu.idatt2001.carljgu.army Class Hierarchy</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="dc.created" content="2022-05-18">
<meta name="description" content="tree: module: edu.ntnu.idatt2001.carljgu.client, package: edu.ntnu.idatt2001.carljgu.army">
<meta name="generator" content="javadoc/PackageTreeWriter">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
......
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Mon May 16 21:38:10 CEST 2022 -->
<!-- Generated by javadoc (17) on Wed May 18 17:57:50 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-16">
<meta name="dc.created" content="2022-05-18">
<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">
......@@ -148,7 +148,7 @@ loadScripts(document, 'script');</script>
<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>
or a null object.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="../army/Army.html" title="class in edu.ntnu.idatt2001.carljgu.army">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>
......@@ -210,7 +210,7 @@ loadScripts(document, 'script');</script>
<h3>getWinner</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="../army/Army.html" title="class in edu.ntnu.idatt2001.carljgu.army">Army</a></span>&nbsp;<span class="element-name">getWinner</span>()</div>
<div class="block">Gets the winner of the army
or a null object</div>
or a null object.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>winner - Army - winner of the simulated battle</dd>
......@@ -249,16 +249,11 @@ loadScripts(document, 'script');</script>
<div class="block">Simulate a battle.
The attacking army is chosen at random.
One random unit from the attacking army attacks
a random unit from the defending army.
Uses the SimulationAttack class to simulate an attack
and puts that information in an arraylist.
If the defender has no health left it is removed.
a random unit from the defending army. Then, if
the defender survives, it attacks the first attacker.
If the defender has no health left, it is removed.
The simulations run until one army
has no units left.
Since the chosen army to attack is random,
it is theoretically possible in all cases
for an army to win without taking any
causalities.</div>
has no units left.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>winner - Army - the army that won.</dd>
......
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Mon May 16 21:38:10 CEST 2022 -->
<!-- Generated by javadoc (17) on Wed May 18 17:57:50 CEST 2022 -->
<title>SimulationAttack</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="dc.created" content="2022-05-18">
<meta name="description" content="declaration: module: edu.ntnu.idatt2001.carljgu.client, package: edu.ntnu.idatt2001.carljgu.battle, class: SimulationAttack">
<meta name="generator" content="javadoc/ClassWriterImpl">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
......@@ -81,16 +81,13 @@ loadScripts(document, 'script');</script>
<div class="type-signature"><span class="modifiers">public class </span><span class="element-name type-name-label">SimulationAttack</span>
<span class="extends-implements">extends <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></span></div>
<div class="deprecation-block"><span class="deprecated-label">Deprecated.</span>
<div class="deprecation-comment">06.05.2022</div>
<div class="deprecation-comment">Provided no extra functionality and made the program harder to read.
Additionally, it had high unnecessary coupling with Army and Unit. 06.05.2022</div>
</div>
<div class="block">This class is deprecated.
A class for keeping track of which unit
has attacked which unit. Helpful when
logging out this information.
Deprecated as it provided no extra functionality
and made the program harder to read. Additionally,
it had high unnecessary coupling with Army and Unit.
Battle use a List of String so this class is not useful.</div>
logging out this information.</div>
<dl class="notes">
<dt>Version:</dt>
<dd>1.2 09.04.2022</dd>
......
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Mon May 16 21:38:10 CEST 2022 -->
<!-- Generated by javadoc (17) on Wed May 18 17:57:50 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-16">
<meta name="dc.created" content="2022-05-18">
<meta name="description" content="declaration: module: edu.ntnu.idatt2001.carljgu.client, package: edu.ntnu.idatt2001.carljgu.battle, enum: Terrain">
<meta name="generator" content="javadoc/ClassWriterImpl">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
......
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Mon May 16 21:38:10 CEST 2022 -->
<!-- Generated by javadoc (17) on Wed May 18 17:57:50 CEST 2022 -->
<title>edu.ntnu.idatt2001.carljgu.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-16">
<meta name="dc.created" content="2022-05-18">
<meta name="description" content="declaration: module: edu.ntnu.idatt2001.carljgu.client, package: edu.ntnu.idatt2001.carljgu.battle">
<meta name="generator" content="javadoc/PackageWriterImpl">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
......@@ -98,7 +98,7 @@ loadScripts(document, 'script');</script>
</div>
<div class="col-first odd-row-color class-summary class-summary-tab2"><a href="SimulationAttack.html" title="class in edu.ntnu.idatt2001.carljgu.battle">SimulationAttack</a></div>
<div class="col-last odd-row-color class-summary class-summary-tab2">Deprecated.
<div class="deprecation-comment">06.05.2022</div>
<div class="deprecation-comment">Provided no extra functionality and made the program harder to read.</div>
</div>
<div class="col-first even-row-color class-summary class-summary-tab3"><a href="Terrain.html" title="enum class in edu.ntnu.idatt2001.carljgu.battle">Terrain</a></div>
<div class="col-last even-row-color class-summary class-summary-tab3">
......
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Mon May 16 21:38:10 CEST 2022 -->
<!-- Generated by javadoc (17) on Wed May 18 17:57:50 CEST 2022 -->
<title>edu.ntnu.idatt2001.carljgu.battle Class Hierarchy</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="dc.created" content="2022-05-18">
<meta name="description" content="tree: module: edu.ntnu.idatt2001.carljgu.client, package: edu.ntnu.idatt2001.carljgu.battle">
<meta name="generator" content="javadoc/PackageTreeWriter">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
......
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Mon May 16 21:38:10 CEST 2022 -->
<!-- Generated by javadoc (17) on Wed May 18 17:57:50 CEST 2022 -->
<title>App</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="dc.created" content="2022-05-18">
<meta name="description" content="declaration: module: edu.ntnu.idatt2001.carljgu.client, package: edu.ntnu.idatt2001.carljgu.client, class: App">
<meta name="generator" content="javadoc/ClassWriterImpl">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
......
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Mon May 16 21:38:10 CEST 2022 -->
<!-- Generated by javadoc (17) on Wed May 18 17:57:50 CEST 2022 -->
<title>BattleController</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="dc.created" content="2022-05-18">
<meta name="description" content="declaration: module: edu.ntnu.idatt2001.carljgu.client, package: edu.ntnu.idatt2001.carljgu.client, class: BattleController">
<meta name="generator" content="javadoc/ClassWriterImpl">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
......
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Mon May 16 21:38:10 CEST 2022 -->
<!-- Generated by javadoc (17) on Wed May 18 17:57:50 CEST 2022 -->
<title>EditArmyController</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="dc.created" content="2022-05-18">
<meta name="description" content="declaration: module: edu.ntnu.idatt2001.carljgu.client, package: edu.ntnu.idatt2001.carljgu.client, class: EditArmyController">
<meta name="generator" content="javadoc/ClassWriterImpl">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
......
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Mon May 16 21:38:10 CEST 2022 -->
<!-- Generated by javadoc (17) on Wed May 18 17:57:50 CEST 2022 -->
<title>Main</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="dc.created" content="2022-05-18">
<meta name="description" content="declaration: module: edu.ntnu.idatt2001.carljgu.client, package: edu.ntnu.idatt2001.carljgu.client, class: Main">
<meta name="generator" content="javadoc/ClassWriterImpl">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
......
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Mon May 16 21:38:10 CEST 2022 -->
<!-- Generated by javadoc (17) on Wed May 18 17:57:50 CEST 2022 -->
<title>DialogBox</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="dc.created" content="2022-05-18">
<meta name="description" content="declaration: module: edu.ntnu.idatt2001.carljgu.client, package: edu.ntnu.idatt2001.carljgu.client.dialogs, class: DialogBox">
<meta name="generator" content="javadoc/ClassWriterImpl">
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment