Add: Added Coverage Screenshots And htlmReport.

This commit is contained in:
GabrieleRadice
2026-06-19 21:50:38 +02:00
parent 6aca188aa3
commit d78b8bbd93
316 changed files with 86329 additions and 0 deletions
@@ -0,0 +1,258 @@
<!DOCTYPE html>
<html id="htmlId">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Coverage Report > Inventor</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.Cards.TribeCards.Characters</a>
</div>
<h1>Coverage Summary for Class: Inventor (it.polimi.ingsw.gc14.Model.Cards.TribeCards.Characters)</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">Inventor</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">
(9/9)
</span>
</td>
<td class="coverageStat">
<span class="percent">
100%
</span>
<span class="absValue">
(18/18)
</span>
</td>
<td class="coverageStat">
<span class="percent">
100%
</span>
<span class="absValue">
(23/23)
</span>
</td>
</tr>
</table>
<br/>
<br/>
<pre>
<code class="sourceCode" id="sourceCode">&nbsp;package it.polimi.ingsw.gc14.Model.Cards.TribeCards.Characters;
&nbsp;import it.polimi.ingsw.gc14.Model.Cards.TribeCards.Character;
&nbsp;import it.polimi.ingsw.gc14.Model.Cards.TribeCards.CharacterType;
&nbsp;import it.polimi.ingsw.gc14.Model.Player;
&nbsp;
&nbsp;/**
&nbsp; * Represents an Inventor character card.
&nbsp; *
&nbsp; * &lt;p&gt;An Inventor is a specific type of {@link Character} initialized with
&nbsp; * {@link CharacterType#INVENTOR}.
&nbsp; */
&nbsp;public class Inventor extends Character {
&nbsp; /**
&nbsp; * The {@code Icons}&#39;s ID. There are a total of 10 different Icons.
&nbsp; */
&nbsp; private int icon;
&nbsp;
&nbsp; /**
&nbsp; * Returns the icon value of this Inventor card.
&nbsp; *
&nbsp; * @return the icon value of this Inventor card.
&nbsp; */
&nbsp; public int getIcon() {
<b class="fc">&nbsp; return icon;</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * Creates an Inventor character card with the specified era and icon value.
&nbsp; *
&nbsp; * @param Era the era of the Inventor card.
&nbsp; * @param icon the icon value of the Inventor card.
&nbsp; * @throws IllegalArgumentException if {@code icon &lt; 0} or {@code icon &gt; 9}.
&nbsp; */
&nbsp; public Inventor(int Era,int icon) throws IllegalArgumentException {
<b class="fc">&nbsp; super(Era, CharacterType.INVENTOR);</b>
<b class="fc">&nbsp; if(icon&lt;0 || icon&gt;9)</b>
<b class="fc">&nbsp; throw new IllegalArgumentException();</b>
<b class="fc">&nbsp; this.icon = icon;</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * Creates an Inventor character card with the specified era, icon value,
&nbsp; * and minimum number of players.
&nbsp; *
&nbsp; * @param Era the era of the Inventor card.
&nbsp; * @param icon the icon value of the Inventor card.
&nbsp; * @param nMin the minimum number of players required for the card.
&nbsp; * @throws IllegalArgumentException if {@code icon &lt; 0} or {@code icon &gt; 9}.
&nbsp; */
&nbsp; public Inventor(int Era,int icon,int nMin) throws IllegalArgumentException {
<b class="fc">&nbsp; super(Era, CharacterType.INVENTOR,nMin);</b>
<b class="fc">&nbsp; if(icon&lt;0 || icon&gt;9)</b>
<b class="fc">&nbsp; throw new IllegalArgumentException();</b>
<b class="fc">&nbsp; this.icon = icon;</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * Creates an Inventor character card with the specified image id, era and icon value.
&nbsp; *
&nbsp; * @param idIMG the image identifier of the Inventor card.
&nbsp; * @param Era the era of the Inventor card.
&nbsp; * @param icon the icon value of the Inventor card.
&nbsp; * @throws IllegalArgumentException if {@code icon &lt; 0} or {@code icon &gt; 9}.
&nbsp; */
&nbsp; public Inventor(String idIMG,int Era,int icon) throws IllegalArgumentException {
<b class="fc">&nbsp; super(idIMG,Era, CharacterType.INVENTOR);</b>
<b class="fc">&nbsp; if(icon&lt;0 || icon&gt;9)</b>
<b class="fc">&nbsp; throw new IllegalArgumentException();</b>
<b class="fc">&nbsp; this.icon = icon;</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * Creates an Inventor character card with the specified image id, era, icon value,
&nbsp; * and minimum number of players.
&nbsp; *
&nbsp; * @param idIMG the image identifier of the Inventor card.
&nbsp; * @param Era the era of the Inventor card.
&nbsp; * @param icon the icon value of the Inventor card.
&nbsp; * @param nMin the minimum number of players required for the card.
&nbsp; * @throws IllegalArgumentException if {@code icon &lt; 0} or {@code icon &gt; 9}.
&nbsp; */
&nbsp; public Inventor(String idIMG,int Era,int icon,int nMin) throws IllegalArgumentException {
<b class="fc">&nbsp; super(idIMG,Era, CharacterType.INVENTOR,nMin);</b>
<b class="fc">&nbsp; if(icon&lt;0 || icon&gt;9)</b>
<b class="fc">&nbsp; throw new IllegalArgumentException();</b>
<b class="fc">&nbsp; this.icon = icon;</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * Returns the string representation of this Inventor card.
&nbsp; *
&nbsp; * @return the string representation of this Inventor card.
&nbsp; */
&nbsp; @Override
&nbsp; public String toString() {
<b class="fc">&nbsp; return super.toString() + &quot;ID:&quot; + String.valueOf(icon);</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * Returns a detailed string representation of this {@code TribeCard}.
&nbsp; * This specific variation is used in the {@code Game}&#39;s toString
&nbsp; * to provide a more detailed version.
&nbsp; *
&nbsp; * &lt;p&gt;Includes:
&nbsp; * &lt;li&gt;{@link #icon Icons&#39;s ID}
&nbsp; * &lt;/p&gt;
&nbsp; *
&nbsp; * @return {@code String} - a string representation of this {@code TribeCard}.
&nbsp; * @see it.polimi.ingsw.gc14.Model.Cards.TribeCard TribeCard
&nbsp; * @see it.polimi.ingsw.gc14.Model.Game Game
&nbsp; * @see it.polimi.ingsw.gc14.Model.GamePackage.Board Board
&nbsp; */
&nbsp; @Override
&nbsp; public String toStringBoard() {
<b class="fc">&nbsp; return super.toStringBoard() + &quot;ID:&quot; + String.valueOf(icon);</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * Creates and returns a copy of this Inventor card.
&nbsp; *
&nbsp; * @return a clone of this Inventor card.
&nbsp; */
&nbsp; @Override
&nbsp; public Character clone() {
<b class="fc">&nbsp; return new Inventor(getIdIMG(),getEra(),icon, getNMin());</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * Inserts this Inventor card into the specified player&#39;s Inventor collection.
&nbsp; *
&nbsp; * &lt;p&gt;The method also applies the building effects related to inventor pairs
&nbsp; * and any building effects triggered by character set completion.
&nbsp; *
&nbsp; * @param player the player who receives the card.
&nbsp; */
&nbsp; @Override
&nbsp; public void insert(Player player) {
<b class="fc">&nbsp; player.getInventors().add(this);</b>
<b class="fc">&nbsp; player.getBuildingCards().stream().filter(b -&gt; b.getEffectId() == 4).forEach(b4 -&gt; b4.applyEffect(player));</b>
<b class="fc">&nbsp; player.getBuildingCards().stream().filter(x-&gt;x.getEffectId()==0).forEach(x-&gt;x.applyEffect(player));</b>
&nbsp; }
&nbsp;}
</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>