Files
2026-06-19 22:57:43 +02:00

183 lines
5.3 KiB
HTML

<!DOCTYPE html>
<html id="htmlId">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Coverage Report > Building1</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: Building1 (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
">
Line, %
</th>
</tr>
<tr>
<td class="name">Building1</td>
<td class="coverageStat">
<span class="percent">
100%
</span>
<span class="absValue">
(1/1)
</span>
</td>
<td class="coverageStat">
<span class="percent">
83.3%
</span>
<span class="absValue">
(5/6)
</span>
</td>
<td class="coverageStat">
<span class="percent">
91.7%
</span>
<span class="absValue">
(11/12)
</span>
</td>
</tr>
</table>
<br/>
<br/>
<pre>
<code class="sourceCode" id="sourceCode">&nbsp;package it.polimi.ingsw.gc14.Model.Cards.Building.Effects;
&nbsp;
&nbsp;import it.polimi.ingsw.gc14.Model.Cards.Building.EffectType;
&nbsp;import it.polimi.ingsw.gc14.Model.Cards.BuildingCard;
&nbsp;import it.polimi.ingsw.gc14.Model.Cards.TribeCards.CharacterType;
&nbsp;
&nbsp;/**
&nbsp; * Building effect that grants a discount of 1 food during the Sustenance Event
&nbsp; * for each character of the indicated type present in the player&#39;s tribe.
&nbsp; */
&nbsp;public class Building1 extends BuildingCard {
&nbsp;
&nbsp; /**
&nbsp; * Character type involved in the building effect.
&nbsp; */
&nbsp; private final CharacterType icon ;
&nbsp;
&nbsp; /**
&nbsp; * Returns the character type associated with this building effect.
&nbsp; *
&nbsp; * @return the character type associated with this building effect.
&nbsp; */
<b class="fc">&nbsp; public CharacterType getIcon() {return icon;}</b>
&nbsp;
&nbsp; /**
&nbsp; * Creates a building with the specified era, price, prestige value
&nbsp; * and character type involved in its effect.
&nbsp; *
&nbsp; * @param era the game era of the building.
&nbsp; * @param price the price in food of the building.
&nbsp; * @param prestigeValue the number of Prestige Points gained from this building at the end of the game.
&nbsp; * @param icon the character type used by the building effect.
&nbsp; */
&nbsp; public Building1(int era, int price,int prestigeValue, CharacterType icon) {
<b class="fc">&nbsp; super(era,price,prestigeValue);</b>
<b class="fc">&nbsp; effectType = EffectType.ON_EVENT;</b>
<b class="fc">&nbsp; effectId = 1;</b>
<b class="fc">&nbsp; this.icon = icon;</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * Creates a building with the specified image identifier, era, price,
&nbsp; * prestige value and character type involved in its effect.
&nbsp; *
&nbsp; * @param idIMG the image identifier of the building.
&nbsp; * @param era the game era of the building.
&nbsp; * @param price the price in food of the building.
&nbsp; * @param prestigeValue the number of Prestige Points gained from this building at the end of the game.
&nbsp; * @param icon the character type used by the building effect.
&nbsp; */
&nbsp; public Building1(String idIMG,int era, int price,int prestigeValue, CharacterType icon) {
<b class="fc">&nbsp; super(idIMG,era,price,prestigeValue);</b>
<b class="fc">&nbsp; effectType = EffectType.ON_EVENT;</b>
<b class="fc">&nbsp; effectId = 1;</b>
<b class="fc">&nbsp; this.icon = icon;</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * Creates a new building instance with the same configuration values
&nbsp; * as this card.
&nbsp; *
&nbsp; * @return a new building card with the same base properties and icon.
&nbsp; */
&nbsp; @Override
&nbsp; public BuildingCard clone() {
<b class="fc">&nbsp; return new Building1(getIdIMG(),getEra(),getPrice(),getPrestigeValue(),getIcon());</b>
&nbsp; }
&nbsp;
&nbsp; @Override
&nbsp; public String toStringBoard() {
<b class="fc">&nbsp; return super.toStringBoard() + &quot; (Icon:&quot; + this.icon.toString().substring(0, 3) + &quot;)&quot;;</b>
&nbsp; }
&nbsp;
&nbsp; @Override
&nbsp; public String toStringPlayer() {
<b class="nc">&nbsp; return super.toStringPlayer() + &quot; (Icon:&quot; + this.icon.toString().substring(0, 3) + &quot;)&quot;;</b>
&nbsp; }
&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-19 22:53</div>
</div>
</body>
</html>