236 lines
7.6 KiB
HTML
236 lines
7.6 KiB
HTML
|
||
|
||
|
||
<!DOCTYPE html>
|
||
<html id="htmlId">
|
||
<head>
|
||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||
<title>Coverage Report > Building11</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.Building.Effects</a>
|
||
</div>
|
||
|
||
<h1>Coverage Summary for Class: Building11 (it.polimi.ingsw.gc14.Model.Cards.Building.Effects)</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">Building11</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">
|
||
(8/8)
|
||
</span>
|
||
</td>
|
||
<td class="coverageStat">
|
||
<span class="percent">
|
||
100%
|
||
</span>
|
||
<span class="absValue">
|
||
(2/2)
|
||
</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.Building.Effects;
|
||
|
||
import it.polimi.ingsw.gc14.Model.Cards.Building.EffectType;
|
||
import it.polimi.ingsw.gc14.Model.Cards.BuildingCard;
|
||
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.CharacterType;
|
||
import it.polimi.ingsw.gc14.Model.Player;
|
||
|
||
/**
|
||
* At the end of the game, the player gains Prestige Points based on the number
|
||
* of cards of the indicated character type in their tribe.
|
||
*
|
||
* <p>The gained amount is equal to the number of matching character cards
|
||
* multiplied by the building's prestige multiplier.
|
||
*/
|
||
public class Building11 extends BuildingCard {
|
||
|
||
/**
|
||
* The character type involved in this building effect.
|
||
*/
|
||
private CharacterType characterType;
|
||
|
||
/**
|
||
* Returns the CharacterType associated with this building card effect.
|
||
*
|
||
* @return the CharacterType associated with this building card effect.
|
||
*/
|
||
<b class="fc"> public CharacterType getIcon() { return characterType; }</b>
|
||
|
||
/**
|
||
* The prestige multiplier applied per matching character card at end of game.
|
||
*/
|
||
private int prestigeMul;
|
||
|
||
/**
|
||
* Returns the prestige multiplier associated with this building card effect.
|
||
*
|
||
* @return the prestige multiplier associated with this building card effect.
|
||
*/
|
||
<b class="fc"> public int getPrestigeMul() {return prestigeMul;}</b>
|
||
|
||
/**
|
||
* Creates a Building11 card with the specified era, price, prestige value,
|
||
* character type icon, and prestige multiplier.
|
||
*
|
||
* @param era the era of the building card.
|
||
* @param price the price of the building card.
|
||
* @param prestigeValue the prestige value of the building card.
|
||
* @param icon the CharacterType associated with the building card effect.
|
||
* @param prestigeMul the prestige multiplier of the building card effect.
|
||
*/
|
||
public Building11(int era, int price,int prestigeValue, CharacterType icon, int prestigeMul) {
|
||
<b class="fc"> super(era,price,prestigeValue);</b>
|
||
<b class="fc"> effectType = EffectType.FINAL;</b>
|
||
<b class="fc"> effectId = 11;</b>
|
||
<b class="fc"> this.characterType = icon;</b>
|
||
<b class="fc"> this.prestigeMul = prestigeMul;</b>
|
||
}
|
||
|
||
/**
|
||
* Creates a Building11 card with the specified image id, era, price, prestige value,
|
||
* character type icon, and prestige multiplier.
|
||
*
|
||
* @param idIMG the image identifier of the building card.
|
||
* @param era the era of the building card.
|
||
* @param price the price of the building card.
|
||
* @param prestigeValue the prestige value of the building card.
|
||
* @param icon the CharacterType associated with the building card effect.
|
||
* @param prestigeMul the prestige multiplier of the building card effect.
|
||
*/
|
||
public Building11(String idIMG,int era, int price,int prestigeValue, CharacterType icon, int prestigeMul) {
|
||
<b class="fc"> super(idIMG,era,price,prestigeValue);</b>
|
||
<b class="fc"> effectType = EffectType.FINAL;</b>
|
||
<b class="fc"> effectId = 11;</b>
|
||
<b class="fc"> this.characterType = icon;</b>
|
||
<b class="fc"> this.prestigeMul = prestigeMul;</b>
|
||
}
|
||
|
||
/**
|
||
* Creates and returns a copy of this Building11 card.
|
||
*
|
||
* @return a clone of this Building11 card.
|
||
*/
|
||
@Override
|
||
public BuildingCard clone() {
|
||
<b class="fc"> return new Building11(getIdIMG(),getEra(),getPrice(),getPrestigeValue(), getIcon(), getPrestigeMul());</b>
|
||
}
|
||
|
||
/**
|
||
* Applies the effect of this building card to the specified player.
|
||
* The effect grants prestige points equal to the number of cards of the
|
||
* associated CharacterType owned by the player, multiplied by the prestige multiplier.
|
||
*
|
||
* @param player the player to whom the effect is applied.
|
||
* @throws IllegalArgumentException if the player does not own this building card.
|
||
*/
|
||
@Override
|
||
public void applyEffect(Player player) throws IllegalArgumentException {
|
||
<b class="fc"> if(!player.getBuildingCards().contains(this))</b>
|
||
<b class="fc"> throw new IllegalArgumentException();</b>
|
||
<b class="fc"> player.addPrestige(player.getNType(getIcon()) * this.getPrestigeMul());</b>
|
||
}
|
||
|
||
/**
|
||
* Returns a string representation of this {@code Building11}, including the
|
||
* character type associated with its effect and its prestige multiplier.
|
||
*
|
||
* @return a string representation of this {@code Building11}.
|
||
*/
|
||
@Override
|
||
public String toString() {
|
||
<b class="fc"> return super.toString() + "+" + this.characterType.toString().substring(0, 3) + "×" + this.prestigeMul;</b>
|
||
}
|
||
|
||
// TODO
|
||
@Override
|
||
public String toStringPlayer() {
|
||
<b class="fc"> return super.toStringPlayer() + " (\uD83C\uDFC5:" + this.characterType.toString().substring(0, 3) + "×" + this.prestigeMul + ")";</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>
|