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,312 @@
<!DOCTYPE html>
<html id="htmlId">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Coverage Report > Slot</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</a>
</div>
<h1>Coverage Summary for Class: Slot (it.polimi.ingsw.gc14.Model)</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">Slot</td>
<td class="coverageStat">
<span class="percent">
100%
</span>
<span class="absValue">
(1/1)
</span>
</td>
<td class="coverageStat">
<span class="percent">
90%
</span>
<span class="absValue">
(9/10)
</span>
</td>
<td class="coverageStat">
<span class="percent">
42.1%
</span>
<span class="absValue">
(8/19)
</span>
</td>
<td class="coverageStat">
<span class="percent">
82.2%
</span>
<span class="absValue">
(37/45)
</span>
</td>
</tr>
</table>
<br/>
<br/>
<pre>
<code class="sourceCode" id="sourceCode">&nbsp;package it.polimi.ingsw.gc14.Model;
&nbsp;import java.io.Serializable;
&nbsp;
&nbsp;/**
&nbsp; * Represents a slot with a specific identifier and associated values
&nbsp; * for upper cards, lower cards, food, and minimum number of players.
&nbsp; * The slot configuration depends on the specified slot identifier.
&nbsp; */
&nbsp;public class Slot implements Serializable {
&nbsp; // Getters
&nbsp;
&nbsp; /**
&nbsp; * The identifier of this slot.
&nbsp; */
&nbsp; private char slotId;
&nbsp;
&nbsp; /**
&nbsp; * Returns the identifier of this slot.
&nbsp; *
&nbsp; * @return the identifier of this slot.
&nbsp; */
&nbsp; public char getSlotId() {
<b class="fc">&nbsp; return slotId;</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * The number of upper cards associated with this slot.
&nbsp; */
&nbsp; private int nUpper;
&nbsp; /**
&nbsp; * Returns the number of upper cards associated with this slot.
&nbsp; *
&nbsp; * @return the number of upper cards associated with this slot.
&nbsp; */
&nbsp; public int getNUpper(){
<b class="fc">&nbsp; return nUpper;</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * The minimum number of players required for this slot.
&nbsp; */
&nbsp; private int nMinPlayer;
&nbsp;
&nbsp; /**
&nbsp; * Returns the minimum number of players required for this slot.
&nbsp; *
&nbsp; * @return the minimum number of players required for this slot.
&nbsp; */
&nbsp; public int getNMinPlayer()
&nbsp; {
<b class="fc">&nbsp; return nMinPlayer;</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * The number of lower cards associated with this slot.
&nbsp; */
&nbsp; private int nLower;
&nbsp;
&nbsp; /**
&nbsp; * Returns the number of lower cards associated with this slot.
&nbsp; *
&nbsp; * @return the number of lower cards associated with this slot.
&nbsp; */
&nbsp; public int getNLower(){
<b class="fc">&nbsp; return nLower;</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * The amount of Food associated with this slot.
&nbsp; */
&nbsp; private int food;
&nbsp;
&nbsp; /**
&nbsp; * Returns the amount of Food associated with this slot.
&nbsp; *
&nbsp; * @return the amount of Food associated with this slot.
&nbsp; */
&nbsp; public int getFood(){
<b class="fc">&nbsp; return food;</b>
&nbsp; }
&nbsp; // End getters
&nbsp;
&nbsp; // Constructors
&nbsp;
&nbsp; /**
&nbsp; * Creates a slot with the specified identifier.
&nbsp; * The slot values for Food, NLower, NUpper, and minimum number of players
&nbsp; * are determined by the given slot identifier.
&nbsp; *
&nbsp; * @param slotId the identifier of the slot.
&nbsp; * @throws IllegalArgumentException if the specified slot identifier is not valid.
&nbsp; */
&nbsp; public Slot(char slotId) throws IllegalArgumentException
<b class="fc">&nbsp; {</b>
<b class="fc">&nbsp; this.slotId = slotId;</b>
<b class="fc">&nbsp; this.nMinPlayer=0;</b>
<b class="fc">&nbsp; switch(slotId)</b>
&nbsp; {
&nbsp; case &#39;A&#39;:
<b class="fc">&nbsp; this.food = 3;</b>
<b class="fc">&nbsp; this.nLower = 0;</b>
<b class="fc">&nbsp; this.nUpper = 0;</b>
<b class="fc">&nbsp; this.nMinPlayer=5;</b>
&nbsp; break;
&nbsp; case &#39;B&#39;:
<b class="fc">&nbsp; this.food = 0;</b>
<b class="fc">&nbsp; this.nLower = 1;</b>
<b class="fc">&nbsp; this.nUpper = 0;</b>
&nbsp; break;
&nbsp; case &#39;C&#39;:
<b class="fc">&nbsp; this.food = 0;</b>
<b class="fc">&nbsp; this.nLower = 0;</b>
<b class="fc">&nbsp; this.nUpper = 1;</b>
&nbsp; break;
&nbsp; case &#39;D&#39;:
<b class="fc">&nbsp; this.food = 0;</b>
<b class="fc">&nbsp; this.nLower = 2;</b>
<b class="fc">&nbsp; this.nUpper = 0;</b>
<b class="fc">&nbsp; this.nMinPlayer = 3;</b>
&nbsp; break;
&nbsp; case &#39;E&#39;:
<b class="fc">&nbsp; this.food = 0;</b>
<b class="fc">&nbsp; this.nLower = 1;</b>
<b class="fc">&nbsp; this.nUpper = 1;</b>
&nbsp; break;
&nbsp; case &#39;F&#39;:
<b class="fc">&nbsp; this.food = 0;</b>
<b class="fc">&nbsp; this.nLower = 0;</b>
<b class="fc">&nbsp; this.nUpper = 2;</b>
&nbsp; break;
&nbsp; case &#39;G&#39;:
<b class="fc">&nbsp; this.food = 0;</b>
<b class="fc">&nbsp; this.nLower = 1;</b>
<b class="fc">&nbsp; this.nUpper = 2;</b>
<b class="fc">&nbsp; this.nMinPlayer = 4;</b>
&nbsp; break;
&nbsp; default:
<b class="fc">&nbsp; throw new IllegalArgumentException();</b>
&nbsp; }
&nbsp; }
&nbsp;
&nbsp;
&nbsp; /**
&nbsp; * Returns the string representation of this slot.
&nbsp; * The returned string includes the slot identifier, number of upper cards,
&nbsp; * number of lower cards, food value, and minimum number of players.
&nbsp; *
&nbsp; * @return the string representation of this slot.
&nbsp; */
&nbsp; @Override
&nbsp; public String toString() {
<b class="fc">&nbsp; return (&quot;SlotID: &quot;+this.getSlotId()+&quot;\nNUpper: &quot;+this.getNUpper()+&quot;\nNLower: &quot;+this.getNLower()+&quot;\nFood: &quot;+this.getFood()+&quot;\n&quot;);</b>
&nbsp; }
&nbsp;
&nbsp;
&nbsp; /**
&nbsp; * Returns a compact string representation of this {@code Slot} for the TUI.
&nbsp; * &lt;p&gt;Includes:
&nbsp; * &lt;ul&gt;
&nbsp; * &lt;li&gt;{@link #slotId}&lt;/li&gt;
&nbsp; * &lt;li&gt;{@link #nUpper} (shown as ▲ symbols)&lt;/li&gt;
&nbsp; * &lt;li&gt;{@link #nLower} (shown as ▼ symbols)&lt;/li&gt;
&nbsp; * &lt;li&gt;{@link #food} (if non-zero)&lt;/li&gt;
&nbsp; * &lt;/ul&gt;
&nbsp; * @return a compact TUI string representation of this {@code Slot}.
&nbsp; * @see it.polimi.ingsw.gc14.Model.Game Game
&nbsp; * @see it.polimi.ingsw.gc14.Model.GamePackage.Board Board
&nbsp; */
&nbsp; public String toStringTUI()
&nbsp; {
<b class="nc">&nbsp; StringBuilder s = new StringBuilder(&quot; &quot;);</b>
<b class="nc">&nbsp; for(int i=0;i&lt;this.getNUpper();i++) s.append(&quot;&quot;);</b>
<b class="nc">&nbsp; for(int i=0;i&lt;this.getNLower();i++) s.append(&quot;&quot;);</b>
<b class="nc">&nbsp; if(getFood()!=0) s.append(&quot;+&quot;+getFood()+&quot; \uD83C\uDF56&quot;);</b>
<b class="nc">&nbsp; s.append(&quot; &quot;);</b>
<b class="nc">&nbsp; return s.toString();</b>
&nbsp; }
&nbsp;
&nbsp; // Functions
&nbsp;
&nbsp; // TODO
&nbsp; @Override
&nbsp; public boolean equals(Object obj) {
<b class="pc">&nbsp; if (this == obj) return true;</b>
<b class="nc">&nbsp; if (!(obj instanceof Slot)) return false;</b>
<b class="nc">&nbsp; return slotId == ((Slot) obj).slotId;</b>
&nbsp; }
&nbsp;
&nbsp; // TODO
&nbsp; @Override
&nbsp; public int hashCode() {
<b class="fc">&nbsp; return Character.hashCode(slotId);</b>
&nbsp; }
&nbsp;
&nbsp; // End functions
&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>