Add: Added Coverage Screenshots And htlmReport.
This commit is contained in:
@@ -0,0 +1,206 @@
|
||||
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html id="htmlId">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<title>Coverage Report > Order2</title>
|
||||
<style type="text/css">
|
||||
@import "../../css/coverage.css";
|
||||
@import "../../css/idea.min.css";
|
||||
</style>
|
||||
<script type="text/javascript" src="../../js/highlight.min.js"></script>
|
||||
<script type="text/javascript" src="../../js/highlightjs-line-numbers.min.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="content">
|
||||
<div class="breadCrumbs">
|
||||
Current scope: <a href="../../index.html">all classes</a>
|
||||
<span class="separator">|</span>
|
||||
<a href="../index.html">it.polimi.ingsw.gc14.Model.Orders</a>
|
||||
</div>
|
||||
|
||||
<h1>Coverage Summary for Class: Order2 (it.polimi.ingsw.gc14.Model.Orders)</h1>
|
||||
|
||||
<table class="coverageStats">
|
||||
<tr>
|
||||
<th class="name">Class</th>
|
||||
<th class="coverageStat
|
||||
">
|
||||
Class, %
|
||||
</th>
|
||||
<th class="coverageStat
|
||||
">
|
||||
Method, %
|
||||
</th>
|
||||
<th class="coverageStat
|
||||
">
|
||||
Branch, %
|
||||
</th>
|
||||
<th class="coverageStat
|
||||
">
|
||||
Line, %
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name">Order2</td>
|
||||
<td class="coverageStat">
|
||||
<span class="percent">
|
||||
100%
|
||||
</span>
|
||||
<span class="absValue">
|
||||
(1/1)
|
||||
</span>
|
||||
</td>
|
||||
<td class="coverageStat">
|
||||
<span class="percent">
|
||||
100%
|
||||
</span>
|
||||
<span class="absValue">
|
||||
(3/3)
|
||||
</span>
|
||||
</td>
|
||||
<td class="coverageStat">
|
||||
<span class="percent">
|
||||
83.3%
|
||||
</span>
|
||||
<span class="absValue">
|
||||
(15/18)
|
||||
</span>
|
||||
</td>
|
||||
<td class="coverageStat">
|
||||
<span class="percent">
|
||||
95.8%
|
||||
</span>
|
||||
<span class="absValue">
|
||||
(23/24)
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<pre>
|
||||
<code class="sourceCode" id="sourceCode"> package it.polimi.ingsw.gc14.Model.Orders;
|
||||
|
||||
import it.polimi.ingsw.gc14.Model.OrderLogicCard;
|
||||
import it.polimi.ingsw.gc14.Model.Player;
|
||||
import it.polimi.ingsw.gc14.View.TUI.AsciiTable;
|
||||
import it.polimi.ingsw.gc14.View.TUI.BorderStyle;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
/**
|
||||
* Represents the order logic card used in a two-player game.
|
||||
*
|
||||
* <p>This class defines the specific turn-order behavior for games with
|
||||
* two players.
|
||||
*/
|
||||
public class Order2 extends OrderLogicCard {
|
||||
|
||||
/**
|
||||
* Creates an Order2 logic card for a two-player game.
|
||||
*
|
||||
* @param players the list of players associated with this order card.
|
||||
* @throws NoSuchElementException if the number of players is not equal to 2.
|
||||
*/
|
||||
public Order2(ArrayList<Player> players) throws NoSuchElementException {
|
||||
<b class="fc"> super(players);</b>
|
||||
<b class="fc"> if(players.size()!=2)</b>
|
||||
<b class="fc"> throw new NoSuchElementException();</b>
|
||||
}
|
||||
|
||||
/**
|
||||
* Applies the effect associated with the specified position index for the given player.
|
||||
* <p>If {@code index == 0}, the player gains 1 Food and the building effect is applied.
|
||||
* <p>If {@code index == 1}, the player tries to remove 1 Food; if the player cannot pay it,
|
||||
* the player loses 2 Prestige.
|
||||
*
|
||||
* @param player the player to whom the effect is applied.
|
||||
* @param index the position index of the effect to apply.
|
||||
* @throws IndexOutOfBoundsException if {@code index < 0} or {@code index >= 2}.
|
||||
*/
|
||||
@Override
|
||||
protected void effect(Player player,int index) throws IndexOutOfBoundsException
|
||||
{
|
||||
<b class="pc"> if(index >= 2 || index < 0)</b>
|
||||
{
|
||||
<b class="fc"> throw new IndexOutOfBoundsException("index out of bounds");</b>
|
||||
}
|
||||
<b class="fc"> if(index==0)</b>
|
||||
{
|
||||
<b class="fc"> player.addFood(1);</b>
|
||||
<b class="fc"> buildingEffect(player);</b>
|
||||
return;
|
||||
}
|
||||
<b class="pc"> if(index==1){</b>
|
||||
<b class="fc"> if(!player.removeFood(1)){</b>
|
||||
<b class="fc"> player.removePrestige(2);</b>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the TURN ORDER box of the TUI.
|
||||
* @return the string containing the box
|
||||
*/
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
<b class="fc"> var table = new AsciiTable(BorderStyle.ROUNDED, 2);</b>
|
||||
<b class="fc"> List<String> stringUp=new ArrayList<>();</b>
|
||||
<b class="fc"> for(int i=0;i<2;i++)</b>
|
||||
{
|
||||
try {
|
||||
<b class="fc"> if(playerList.get(i).isPlayed())</b>
|
||||
<b class="fc"> stringUp.add("");</b>
|
||||
else
|
||||
<b class="pc"> stringUp.add(playerList.get(i).getPlayer().getTotem() != null ? playerList.get(i).getPlayer().getTotem().toString() : playerList.get(i).getPlayer().getUserName());</b>
|
||||
}
|
||||
catch (IndexOutOfBoundsException e) {
|
||||
<b class="nc"> stringUp.add("");</b>
|
||||
}
|
||||
}
|
||||
<b class="fc"> table.addRow(stringUp);</b>
|
||||
|
||||
<b class="fc"> List<String> stringList=new ArrayList<>();</b>
|
||||
<b class="fc"> stringList.add("+1\uD83C\uDF56");</b>
|
||||
<b class="fc"> stringList.add("-1\uD83C\uDF56/-2\uD83C\uDFC5");</b>
|
||||
<b class="fc"> table.addRow(stringList);</b>
|
||||
<b class="fc"> return table.build() + "\n";</b>
|
||||
}
|
||||
}
|
||||
</code>
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function() {
|
||||
var msie = false, msie9 = false;
|
||||
/*@cc_on
|
||||
msie = true;
|
||||
@if (@_jscript_version >= 9)
|
||||
msie9 = true;
|
||||
@end
|
||||
@*/
|
||||
|
||||
if (!msie || msie && msie9) {
|
||||
hljs.highlightAll()
|
||||
hljs.initLineNumbersOnLoad();
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
||||
<div class="footer">
|
||||
|
||||
<div style="float:right;">generated on 2026-06-14 21:53</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user