Files
Progetto-ingegneria-del-sof…/deliverables/Coverage/htmlReport/ns-3/sources/source-5.html
T
2026-06-19 21:50:38 +02:00

205 lines
5.0 KiB
HTML

<!DOCTYPE html>
<html id="htmlId">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Coverage Report > PlayableCard</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: PlayableCard (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">PlayableCard</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">
(8/8)
</span>
</td>
<td class="coverageStat">
<span class="percent">
100%
</span>
<span class="absValue">
(14/14)
</span>
</td>
</tr>
</table>
<br/>
<br/>
<pre>
<code class="sourceCode" id="sourceCode">&nbsp;package it.polimi.ingsw.gc14.Model;
&nbsp;import java.io.Serializable;
&nbsp;
&nbsp;
&nbsp;/**
&nbsp; * Abstract base class for all playable cards.
&nbsp; * A PlayableCard is characterized by an era value.
&nbsp; */
&nbsp;public abstract class PlayableCard implements Serializable {
&nbsp;
&nbsp; /**
&nbsp; * The image identifier of the playable card.
&nbsp; */
&nbsp; private String idIMG;
&nbsp;
&nbsp; /**
&nbsp; * Returns the image identifier of this playable card.
&nbsp; *
&nbsp; * @return the image identifier of this playable card.
&nbsp; */
&nbsp; public String getIdIMG() {
<b class="fc">&nbsp; return idIMG;</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * The era associated with this playable card.
&nbsp; */
&nbsp; private int era;
&nbsp;
&nbsp; /**
&nbsp; * Returns the era of this playable card.
&nbsp; *
&nbsp; * @return the era of this playable card.
&nbsp; */
&nbsp; public int getEra(){
<b class="fc">&nbsp; return era;</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * Creates a playable card with the specified era.
&nbsp; *
&nbsp; * @param era the era of the playable card.
&nbsp; * @throws IllegalArgumentException if {@code era &lt;= 0} or {@code era &gt;= 4}.
&nbsp; */
<b class="fc">&nbsp; public PlayableCard(int era) throws IllegalArgumentException {</b>
<b class="fc">&nbsp; idIMG = &quot;-1&quot;;</b>
<b class="fc">&nbsp; if (era &gt; 0 &amp;&amp; era &lt; 4) {</b>
<b class="fc">&nbsp; this.era = era;</b>
&nbsp; } else {
<b class="fc">&nbsp; throw new IllegalArgumentException();</b>
&nbsp; }
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * Creates a playable card with the specified image id and era.
&nbsp; *
&nbsp; * @param idIMG the image identifier of the playable card.
&nbsp; * @param era the era of the playable card.
&nbsp; * @throws IllegalArgumentException if {@code era &lt;= 0} or {@code era &gt;= 4}.
&nbsp; */
<b class="fc">&nbsp; public PlayableCard(String idIMG, int era) throws IllegalArgumentException {</b>
<b class="fc">&nbsp; this.idIMG = idIMG;</b>
<b class="fc">&nbsp; if (era &gt; 0 &amp;&amp; era &lt; 4) {</b>
<b class="fc">&nbsp; this.era = era;</b>
&nbsp; } else {
<b class="fc">&nbsp; throw new IllegalArgumentException();</b>
&nbsp; }
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * Returns a string representation of this playable card.
&nbsp; *
&nbsp; * @return a string representation of this playable card.
&nbsp; */
&nbsp; @Override
&nbsp; public String toString() {
<b class="fc">&nbsp; return &quot;&quot;;</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * Returns a compact string representation used when rendering the board in the TUI.
&nbsp; *
&nbsp; * @return a compact board representation of this card.
&nbsp; */
&nbsp; public String toStringBoard() {
<b class="fc">&nbsp; return &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-14 21:53</div>
</div>
</body>
</html>