Add: Added Coverage Screenshots And htlmReport.
This commit is contained in:
@@ -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"> package it.polimi.ingsw.gc14.Model.Cards.TribeCards.Characters;
|
||||
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.Character;
|
||||
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.CharacterType;
|
||||
import it.polimi.ingsw.gc14.Model.Player;
|
||||
|
||||
/**
|
||||
* Represents an Inventor character card.
|
||||
*
|
||||
* <p>An Inventor is a specific type of {@link Character} initialized with
|
||||
* {@link CharacterType#INVENTOR}.
|
||||
*/
|
||||
public class Inventor extends Character {
|
||||
/**
|
||||
* The {@code Icons}'s ID. There are a total of 10 different Icons.
|
||||
*/
|
||||
private int icon;
|
||||
|
||||
/**
|
||||
* Returns the icon value of this Inventor card.
|
||||
*
|
||||
* @return the icon value of this Inventor card.
|
||||
*/
|
||||
public int getIcon() {
|
||||
<b class="fc"> return icon;</b>
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an Inventor character card with the specified era and icon value.
|
||||
*
|
||||
* @param Era the era of the Inventor card.
|
||||
* @param icon the icon value of the Inventor card.
|
||||
* @throws IllegalArgumentException if {@code icon < 0} or {@code icon > 9}.
|
||||
*/
|
||||
public Inventor(int Era,int icon) throws IllegalArgumentException {
|
||||
<b class="fc"> super(Era, CharacterType.INVENTOR);</b>
|
||||
<b class="fc"> if(icon<0 || icon>9)</b>
|
||||
<b class="fc"> throw new IllegalArgumentException();</b>
|
||||
<b class="fc"> this.icon = icon;</b>
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an Inventor character card with the specified era, icon value,
|
||||
* and minimum number of players.
|
||||
*
|
||||
* @param Era the era of the Inventor card.
|
||||
* @param icon the icon value of the Inventor card.
|
||||
* @param nMin the minimum number of players required for the card.
|
||||
* @throws IllegalArgumentException if {@code icon < 0} or {@code icon > 9}.
|
||||
*/
|
||||
public Inventor(int Era,int icon,int nMin) throws IllegalArgumentException {
|
||||
<b class="fc"> super(Era, CharacterType.INVENTOR,nMin);</b>
|
||||
<b class="fc"> if(icon<0 || icon>9)</b>
|
||||
<b class="fc"> throw new IllegalArgumentException();</b>
|
||||
<b class="fc"> this.icon = icon;</b>
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an Inventor character card with the specified image id, era and icon value.
|
||||
*
|
||||
* @param idIMG the image identifier of the Inventor card.
|
||||
* @param Era the era of the Inventor card.
|
||||
* @param icon the icon value of the Inventor card.
|
||||
* @throws IllegalArgumentException if {@code icon < 0} or {@code icon > 9}.
|
||||
*/
|
||||
public Inventor(String idIMG,int Era,int icon) throws IllegalArgumentException {
|
||||
<b class="fc"> super(idIMG,Era, CharacterType.INVENTOR);</b>
|
||||
<b class="fc"> if(icon<0 || icon>9)</b>
|
||||
<b class="fc"> throw new IllegalArgumentException();</b>
|
||||
<b class="fc"> this.icon = icon;</b>
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an Inventor character card with the specified image id, era, icon value,
|
||||
* and minimum number of players.
|
||||
*
|
||||
* @param idIMG the image identifier of the Inventor card.
|
||||
* @param Era the era of the Inventor card.
|
||||
* @param icon the icon value of the Inventor card.
|
||||
* @param nMin the minimum number of players required for the card.
|
||||
* @throws IllegalArgumentException if {@code icon < 0} or {@code icon > 9}.
|
||||
*/
|
||||
public Inventor(String idIMG,int Era,int icon,int nMin) throws IllegalArgumentException {
|
||||
<b class="fc"> super(idIMG,Era, CharacterType.INVENTOR,nMin);</b>
|
||||
<b class="fc"> if(icon<0 || icon>9)</b>
|
||||
<b class="fc"> throw new IllegalArgumentException();</b>
|
||||
<b class="fc"> this.icon = icon;</b>
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the string representation of this Inventor card.
|
||||
*
|
||||
* @return the string representation of this Inventor card.
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
<b class="fc"> return super.toString() + "ID:" + String.valueOf(icon);</b>
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a detailed string representation of this {@code TribeCard}.
|
||||
* This specific variation is used in the {@code Game}'s toString
|
||||
* to provide a more detailed version.
|
||||
*
|
||||
* <p>Includes:
|
||||
* <li>{@link #icon Icons's ID}
|
||||
* </p>
|
||||
*
|
||||
* @return {@code String} - a string representation of this {@code TribeCard}.
|
||||
* @see it.polimi.ingsw.gc14.Model.Cards.TribeCard TribeCard
|
||||
* @see it.polimi.ingsw.gc14.Model.Game Game
|
||||
* @see it.polimi.ingsw.gc14.Model.GamePackage.Board Board
|
||||
*/
|
||||
@Override
|
||||
public String toStringBoard() {
|
||||
<b class="fc"> return super.toStringBoard() + "ID:" + String.valueOf(icon);</b>
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates and returns a copy of this Inventor card.
|
||||
*
|
||||
* @return a clone of this Inventor card.
|
||||
*/
|
||||
@Override
|
||||
public Character clone() {
|
||||
<b class="fc"> return new Inventor(getIdIMG(),getEra(),icon, getNMin());</b>
|
||||
}
|
||||
|
||||
/**
|
||||
* Inserts this Inventor card into the specified player's Inventor collection.
|
||||
*
|
||||
* <p>The method also applies the building effects related to inventor pairs
|
||||
* and any building effects triggered by character set completion.
|
||||
*
|
||||
* @param player the player who receives the card.
|
||||
*/
|
||||
@Override
|
||||
public void insert(Player player) {
|
||||
<b class="fc"> player.getInventors().add(this);</b>
|
||||
<b class="fc"> player.getBuildingCards().stream().filter(b -> b.getEffectId() == 4).forEach(b4 -> b4.applyEffect(player));</b>
|
||||
<b class="fc"> player.getBuildingCards().stream().filter(x->x.getEffectId()==0).forEach(x->x.applyEffect(player));</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