Add: Added Coverage Screenshots And htlmReport.
This commit is contained in:
@@ -0,0 +1,219 @@
|
||||
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html id="htmlId">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<title>Coverage Report > Hunt</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.Events</a>
|
||||
</div>
|
||||
|
||||
<h1>Coverage Summary for Class: Hunt (it.polimi.ingsw.gc14.Model.Cards.TribeCards.Events)</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">Hunt</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">
|
||||
(6/6)
|
||||
</span>
|
||||
</td>
|
||||
<td class="coverageStat">
|
||||
<span class="percent">
|
||||
100%
|
||||
</span>
|
||||
<span class="absValue">
|
||||
(6/6)
|
||||
</span>
|
||||
</td>
|
||||
<td class="coverageStat">
|
||||
<span class="percent">
|
||||
100%
|
||||
</span>
|
||||
<span class="absValue">
|
||||
(18/18)
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<pre>
|
||||
<code class="sourceCode" id="sourceCode"> package it.polimi.ingsw.gc14.Model.Cards.TribeCards.Events;
|
||||
|
||||
import it.polimi.ingsw.gc14.Model.Cards.BuildingCard;
|
||||
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.CharacterType;
|
||||
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.EventType;
|
||||
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.EventCard;
|
||||
import it.polimi.ingsw.gc14.Model.Player;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* When activated, gives Food and Prestige Points to every player.
|
||||
*
|
||||
* @see EventCard
|
||||
*/
|
||||
public class Hunt extends EventCard {
|
||||
/** Base food units granted per Hunter. Always 1; increased by Building 7. */
|
||||
private static final int BASE_FOOD_PER_HUNTER = 1;
|
||||
|
||||
/** Prestige Points multiplier used during the event. */
|
||||
private int prestigeMultiplier;
|
||||
|
||||
<b class="fc"> int getPrestigeMultiplier() { return prestigeMultiplier; }</b>
|
||||
|
||||
/**
|
||||
* Creates a new Hunt event card.
|
||||
*
|
||||
* @param Era the era of the card
|
||||
* @param prestigeMultiplier prestige points multiplicator used during the event
|
||||
*/
|
||||
public Hunt(int Era, int prestigeMultiplier) {
|
||||
<b class="fc"> super(Era, EventType.HUNT);</b>
|
||||
<b class="fc"> this.prestigeMultiplier = prestigeMultiplier;</b>
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new Hunt event card.
|
||||
*
|
||||
* @param idIMG the image identifier of the Hunt event card.
|
||||
* @param Era the era of the card.
|
||||
* @param prestigeMultiplier the prestige points multiplier used during the event.
|
||||
*/
|
||||
public Hunt(String idIMG, int Era, int prestigeMultiplier) {
|
||||
<b class="fc"> super(idIMG, Era, EventType.HUNT);</b>
|
||||
<b class="fc"> this.prestigeMultiplier = prestigeMultiplier;</b>
|
||||
}
|
||||
|
||||
/**
|
||||
* Activates the event card "Hunt".
|
||||
* Each player gains Food and Prestige Points for each Hunter in their tribe,
|
||||
* multiplied by the respective multipliers (base food per hunter is 1).
|
||||
* Buildings influence:
|
||||
* Building 7: adds 1 to both the food and prestige multiplier for each copy owned.
|
||||
*
|
||||
* @param playerList the list of all players in the game.
|
||||
*/
|
||||
@Override
|
||||
public void activateEvent (ArrayList <Player> playerList){
|
||||
<b class="fc"> for (Player player : playerList) {</b>
|
||||
<b class="fc"> int tmpFoodMultiplier = BASE_FOOD_PER_HUNTER;</b>
|
||||
<b class="fc"> int tmpPrestigeMultiplier = prestigeMultiplier;</b>
|
||||
|
||||
<b class="fc"> ArrayList <BuildingCard> buildingList = player.getBuildingCards();</b>
|
||||
<b class="fc"> int hunterCounter=player.getNType(CharacterType.HUNTER);</b>
|
||||
|
||||
<b class="fc"> for (BuildingCard buildingCard : buildingList) {</b>
|
||||
<b class="fc"> if (buildingCard.getEffectId() == 7) {</b>
|
||||
<b class="fc"> tmpFoodMultiplier++;</b>
|
||||
<b class="fc"> tmpPrestigeMultiplier++;</b>
|
||||
}
|
||||
}
|
||||
|
||||
<b class="fc"> player.addFood(tmpFoodMultiplier * hunterCounter);</b>
|
||||
<b class="fc"> player.addPrestige(tmpPrestigeMultiplier * hunterCounter);</b>
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates and returns a copy of this Hunt card.
|
||||
*
|
||||
* @return a new Hunt card with the same era and prestige multiplier
|
||||
*/
|
||||
@Override
|
||||
public EventCard clone() {
|
||||
<b class="fc"> return new Hunt(getIdIMG(),getEra(), prestigeMultiplier);</b>
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints a string representation of this {@code TribeCard}. This specific variation is used in the {@code Game}'s
|
||||
* toString to print a more detailed version.
|
||||
* <p>includes:
|
||||
* <li>{@link #prestigeMultiplier}
|
||||
* </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()+" 1\uD83C\uDF56+"+prestigeMultiplier+"\uD83C\uDFC5"+"×\uD83C\uDFF9";</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