Add: Added Coverage Screenshots And htlmReport.
This commit is contained in:
@@ -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"> package it.polimi.ingsw.gc14.Model;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Represents a slot with a specific identifier and associated values
|
||||
* for upper cards, lower cards, food, and minimum number of players.
|
||||
* The slot configuration depends on the specified slot identifier.
|
||||
*/
|
||||
public class Slot implements Serializable {
|
||||
// Getters
|
||||
|
||||
/**
|
||||
* The identifier of this slot.
|
||||
*/
|
||||
private char slotId;
|
||||
|
||||
/**
|
||||
* Returns the identifier of this slot.
|
||||
*
|
||||
* @return the identifier of this slot.
|
||||
*/
|
||||
public char getSlotId() {
|
||||
<b class="fc"> return slotId;</b>
|
||||
}
|
||||
|
||||
/**
|
||||
* The number of upper cards associated with this slot.
|
||||
*/
|
||||
private int nUpper;
|
||||
/**
|
||||
* Returns the number of upper cards associated with this slot.
|
||||
*
|
||||
* @return the number of upper cards associated with this slot.
|
||||
*/
|
||||
public int getNUpper(){
|
||||
<b class="fc"> return nUpper;</b>
|
||||
}
|
||||
|
||||
/**
|
||||
* The minimum number of players required for this slot.
|
||||
*/
|
||||
private int nMinPlayer;
|
||||
|
||||
/**
|
||||
* Returns the minimum number of players required for this slot.
|
||||
*
|
||||
* @return the minimum number of players required for this slot.
|
||||
*/
|
||||
public int getNMinPlayer()
|
||||
{
|
||||
<b class="fc"> return nMinPlayer;</b>
|
||||
}
|
||||
|
||||
/**
|
||||
* The number of lower cards associated with this slot.
|
||||
*/
|
||||
private int nLower;
|
||||
|
||||
/**
|
||||
* Returns the number of lower cards associated with this slot.
|
||||
*
|
||||
* @return the number of lower cards associated with this slot.
|
||||
*/
|
||||
public int getNLower(){
|
||||
<b class="fc"> return nLower;</b>
|
||||
}
|
||||
|
||||
/**
|
||||
* The amount of Food associated with this slot.
|
||||
*/
|
||||
private int food;
|
||||
|
||||
/**
|
||||
* Returns the amount of Food associated with this slot.
|
||||
*
|
||||
* @return the amount of Food associated with this slot.
|
||||
*/
|
||||
public int getFood(){
|
||||
<b class="fc"> return food;</b>
|
||||
}
|
||||
// End getters
|
||||
|
||||
// Constructors
|
||||
|
||||
/**
|
||||
* Creates a slot with the specified identifier.
|
||||
* The slot values for Food, NLower, NUpper, and minimum number of players
|
||||
* are determined by the given slot identifier.
|
||||
*
|
||||
* @param slotId the identifier of the slot.
|
||||
* @throws IllegalArgumentException if the specified slot identifier is not valid.
|
||||
*/
|
||||
public Slot(char slotId) throws IllegalArgumentException
|
||||
<b class="fc"> {</b>
|
||||
<b class="fc"> this.slotId = slotId;</b>
|
||||
<b class="fc"> this.nMinPlayer=0;</b>
|
||||
<b class="fc"> switch(slotId)</b>
|
||||
{
|
||||
case 'A':
|
||||
<b class="fc"> this.food = 3;</b>
|
||||
<b class="fc"> this.nLower = 0;</b>
|
||||
<b class="fc"> this.nUpper = 0;</b>
|
||||
<b class="fc"> this.nMinPlayer=5;</b>
|
||||
break;
|
||||
case 'B':
|
||||
<b class="fc"> this.food = 0;</b>
|
||||
<b class="fc"> this.nLower = 1;</b>
|
||||
<b class="fc"> this.nUpper = 0;</b>
|
||||
break;
|
||||
case 'C':
|
||||
<b class="fc"> this.food = 0;</b>
|
||||
<b class="fc"> this.nLower = 0;</b>
|
||||
<b class="fc"> this.nUpper = 1;</b>
|
||||
break;
|
||||
case 'D':
|
||||
<b class="fc"> this.food = 0;</b>
|
||||
<b class="fc"> this.nLower = 2;</b>
|
||||
<b class="fc"> this.nUpper = 0;</b>
|
||||
<b class="fc"> this.nMinPlayer = 3;</b>
|
||||
break;
|
||||
case 'E':
|
||||
<b class="fc"> this.food = 0;</b>
|
||||
<b class="fc"> this.nLower = 1;</b>
|
||||
<b class="fc"> this.nUpper = 1;</b>
|
||||
break;
|
||||
case 'F':
|
||||
<b class="fc"> this.food = 0;</b>
|
||||
<b class="fc"> this.nLower = 0;</b>
|
||||
<b class="fc"> this.nUpper = 2;</b>
|
||||
break;
|
||||
case 'G':
|
||||
<b class="fc"> this.food = 0;</b>
|
||||
<b class="fc"> this.nLower = 1;</b>
|
||||
<b class="fc"> this.nUpper = 2;</b>
|
||||
<b class="fc"> this.nMinPlayer = 4;</b>
|
||||
break;
|
||||
default:
|
||||
<b class="fc"> throw new IllegalArgumentException();</b>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the string representation of this slot.
|
||||
* The returned string includes the slot identifier, number of upper cards,
|
||||
* number of lower cards, food value, and minimum number of players.
|
||||
*
|
||||
* @return the string representation of this slot.
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
<b class="fc"> return ("SlotID: "+this.getSlotId()+"\nNUpper: "+this.getNUpper()+"\nNLower: "+this.getNLower()+"\nFood: "+this.getFood()+"\n");</b>
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a compact string representation of this {@code Slot} for the TUI.
|
||||
* <p>Includes:
|
||||
* <ul>
|
||||
* <li>{@link #slotId}</li>
|
||||
* <li>{@link #nUpper} (shown as ▲ symbols)</li>
|
||||
* <li>{@link #nLower} (shown as ▼ symbols)</li>
|
||||
* <li>{@link #food} (if non-zero)</li>
|
||||
* </ul>
|
||||
* @return a compact TUI string representation of this {@code Slot}.
|
||||
* @see it.polimi.ingsw.gc14.Model.Game Game
|
||||
* @see it.polimi.ingsw.gc14.Model.GamePackage.Board Board
|
||||
*/
|
||||
public String toStringTUI()
|
||||
{
|
||||
<b class="nc"> StringBuilder s = new StringBuilder(" ");</b>
|
||||
<b class="nc"> for(int i=0;i<this.getNUpper();i++) s.append("▲");</b>
|
||||
<b class="nc"> for(int i=0;i<this.getNLower();i++) s.append("▼");</b>
|
||||
<b class="nc"> if(getFood()!=0) s.append("+"+getFood()+" \uD83C\uDF56");</b>
|
||||
<b class="nc"> s.append(" ");</b>
|
||||
<b class="nc"> return s.toString();</b>
|
||||
}
|
||||
|
||||
// Functions
|
||||
|
||||
// TODO
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
<b class="pc"> if (this == obj) return true;</b>
|
||||
<b class="nc"> if (!(obj instanceof Slot)) return false;</b>
|
||||
<b class="nc"> return slotId == ((Slot) obj).slotId;</b>
|
||||
}
|
||||
|
||||
// TODO
|
||||
@Override
|
||||
public int hashCode() {
|
||||
<b class="fc"> return Character.hashCode(slotId);</b>
|
||||
}
|
||||
|
||||
// End functions
|
||||
}
|
||||
</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