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

214 lines
6.0 KiB
HTML

<!DOCTYPE html>
<html id="htmlId">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Coverage Report > Character</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</a>
</div>
<h1>Coverage Summary for Class: Character (it.polimi.ingsw.gc14.Model.Cards.TribeCards)</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">Character</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">
(10/10)
</span>
</td>
</tr>
</table>
<br/>
<br/>
<pre>
<code class="sourceCode" id="sourceCode">&nbsp;package it.polimi.ingsw.gc14.Model.Cards.TribeCards;
&nbsp;
&nbsp;import it.polimi.ingsw.gc14.Model.Cards.TribeCard;
&nbsp;import it.polimi.ingsw.gc14.Model.Player;
&nbsp;
&nbsp;/**
&nbsp; * Abstract base class for all character cards.
&nbsp; *
&nbsp; * &lt;p&gt;A Character is a {@link TribeCard} that is not an event card and is associated
&nbsp; * with a specific {@link CharacterType}.
&nbsp; */
&nbsp;public abstract class Character extends TribeCard implements Cloneable {
&nbsp;
&nbsp; /**
&nbsp; * The specific type of this character card.
&nbsp; */
&nbsp; private CharacterType type;
&nbsp;
&nbsp; /**
&nbsp; * Returns the type of this character card.
&nbsp; *
&nbsp; * @return the type of this character card.
&nbsp; */
&nbsp; public CharacterType getType() {
<b class="fc">&nbsp; return type;</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * Creates a character card with the specified era and character type.
&nbsp; *
&nbsp; * @param Era the era of the character card.
&nbsp; * @param type the type of the character card.
&nbsp; */
&nbsp; public Character(int Era, CharacterType type){
<b class="fc">&nbsp; super(Era,false );</b>
<b class="fc">&nbsp; this.type = type;</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * Creates a character card with the specified image id, era and character type.
&nbsp; *
&nbsp; * @param idIMG the image identifier of the character card.
&nbsp; * @param Era the era of the character card.
&nbsp; * @param type the type of the character card.
&nbsp; */
&nbsp; public Character(String idIMG,int Era, CharacterType type){
<b class="fc">&nbsp; super(idIMG,Era,false );</b>
<b class="fc">&nbsp; this.type = type;</b>
&nbsp; }
&nbsp;
&nbsp;
&nbsp; /**
&nbsp; * Creates a character card with the specified era, character type,
&nbsp; * and minimum number of players.
&nbsp; *
&nbsp; * @param Era the era of the character card.
&nbsp; * @param type the type of the character card.
&nbsp; * @param nMin the minimum number of players required for the card.
&nbsp; */
&nbsp; public Character(int Era, CharacterType type,int nMin){
<b class="fc">&nbsp; super(Era,false ,nMin);</b>
<b class="fc">&nbsp; this.type = type;</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * Creates a character card with the specified image id, era, character type,
&nbsp; * and minimum number of players.
&nbsp; *
&nbsp; * @param idIMG the image identifier of the character card.
&nbsp; * @param Era the era of the character card.
&nbsp; * @param type the type of the character card.
&nbsp; * @param nMin the minimum number of players required for the card.
&nbsp; */
&nbsp; public Character(String idIMG,int Era, CharacterType type,int nMin){
<b class="fc">&nbsp; super(idIMG,Era,false ,nMin);</b>
<b class="fc">&nbsp; this.type = type;</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * Returns a string representation of this {@code Character}. This specific variation is used in the {@code Game}&#39;s
&nbsp; * toString to provide a more detailed version.
&nbsp; * &lt;p&gt;Includes:
&nbsp; * &lt;li&gt;{@link it.polimi.ingsw.gc14.Model.Cards.TribeCards.CharacterType Type}
&nbsp; * &lt;/p&gt;
&nbsp; * @return {@code String} - a string representation of this {@code Character}.
&nbsp; * @see it.polimi.ingsw.gc14.Model.Game Game
&nbsp; * @see it.polimi.ingsw.gc14.Model.GamePackage.Board Board
&nbsp; */
&nbsp; @Override
&nbsp; public String toStringBoard()
&nbsp; {
<b class="fc">&nbsp; return super.toStringBoard()+&quot; &quot;+getType().toString()+&quot; &quot;;</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * Creates and returns a copy of this character card.
&nbsp; *
&nbsp; * @return a clone of this character card.
&nbsp; */
&nbsp; @Override
&nbsp; public abstract Character clone();
&nbsp;
&nbsp; /**
&nbsp; * Inserts this character card into the appropriate collection of the specified player.
&nbsp; *
&nbsp; * @param player the player who receives the character card.
&nbsp; */
&nbsp; public abstract void insert(Player player);
&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>