FIx: Fixed Coverage Screenshots And htmlRepot.

This commit is contained in:
GabrieleRadice
2026-06-19 22:57:43 +02:00
parent a4dc8b2540
commit 0129efe400
316 changed files with 4566 additions and 4497 deletions
@@ -0,0 +1,182 @@
<!DOCTYPE html>
<html id="htmlId">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Coverage Report > AddPlayer</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.Network.NetworkEvents</a>
</div>
<h1>Coverage Summary for Class: AddPlayer (it.polimi.ingsw.gc14.Network.NetworkEvents)</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">AddPlayer</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/1)
</span>
</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/4)
</span>
</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/2)
</span>
</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/13)
</span>
</td>
</tr>
</table>
<br/>
<br/>
<pre>
<code class="sourceCode" id="sourceCode">&nbsp;package it.polimi.ingsw.gc14.Network.NetworkEvents;
&nbsp;
&nbsp;import it.polimi.ingsw.gc14.Controller.GameController;
&nbsp;import it.polimi.ingsw.gc14.ErrorType;
&nbsp;import it.polimi.ingsw.gc14.Model.MiniModel;
&nbsp;import it.polimi.ingsw.gc14.Network.EventType;
&nbsp;import it.polimi.ingsw.gc14.Network.NetworkEvent;
&nbsp;
&nbsp;/**
&nbsp; * Network event used to register a new player in the lobby.
&nbsp; *
&nbsp; * &lt;p&gt;The first player to join also proposes the desired number of players
&nbsp; * for the match. Subsequent joiners ignore {@code proposedNPlayer} if the
&nbsp; * game has already been created.
&nbsp; */
&nbsp;public class AddPlayer extends NetworkEvent {
&nbsp; /** Number of players proposed by this player; used only when creating a new game. */
&nbsp; private final int proposedNPlayer;
&nbsp;
&nbsp; /**
&nbsp; * @return the number of proposed players to add to the match
&nbsp; */
&nbsp; public int getProposedNPlayer() {
<b class="nc">&nbsp; return proposedNPlayer;</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * Class constructor.
&nbsp; * Initializes all the attributes.
&nbsp; * @param username the name of the player requesting the event
&nbsp; * @param proposedNPlayer the number of proposed players to add to the match
&nbsp; */
&nbsp; public AddPlayer(String username, int proposedNPlayer) {
<b class="nc">&nbsp; super(username, EventType.ADD_PLAYER, false, ErrorType.GENERIC_ERROR);</b>
<b class="nc">&nbsp; this.proposedNPlayer = proposedNPlayer;</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * @param gameController the Game Controller on which to apply the event
&nbsp; * @return true if the player could be added to the match, false otherwise
&nbsp; */
&nbsp; @Override
&nbsp; public boolean apply(GameController gameController)
&nbsp; {
<b class="nc">&nbsp; return gameController.addPlayer(username);</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * Applies this event to the client-side mini model, updating players,
&nbsp; * turn order, game state, and slot map.
&nbsp; *
&nbsp; * @param miniModel the client-side model to update.
&nbsp; */
&nbsp; @Override
&nbsp; public void apply(MiniModel miniModel){
<b class="nc">&nbsp; synchronized (miniModel) {</b>
<b class="nc">&nbsp; if (isError)</b>
<b class="nc">&nbsp; return;</b>
<b class="nc">&nbsp; miniModel.setPlayers(playerList);</b>
<b class="nc">&nbsp; miniModel.setOrderLogicCard(orderLogicCard);</b>
<b class="nc">&nbsp; miniModel.setCurrentState(currentState);</b>
<b class="nc">&nbsp; miniModel.setSlotPlayerMap(slotPlayerMap);</b>
<b class="nc">&nbsp; miniModel.setLastEvent(this);</b>
<b class="nc">&nbsp; }</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>
@@ -0,0 +1,201 @@
<!DOCTYPE html>
<html id="htmlId">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Coverage Report > ApplyNextRound</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.Network.NetworkEvents</a>
</div>
<h1>Coverage Summary for Class: ApplyNextRound (it.polimi.ingsw.gc14.Network.NetworkEvents)</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">ApplyNextRound</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/1)
</span>
</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/3)
</span>
</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/18)
</span>
</td>
</tr>
</table>
<br/>
<br/>
<pre>
<code class="sourceCode" id="sourceCode">&nbsp;package it.polimi.ingsw.gc14.Network.NetworkEvents;
&nbsp;
&nbsp;import it.polimi.ingsw.gc14.Controller.GameController;
&nbsp;import it.polimi.ingsw.gc14.ErrorType;
&nbsp;import it.polimi.ingsw.gc14.Model.Cards.BuildingCard;
&nbsp;import it.polimi.ingsw.gc14.Model.Cards.TribeCard;
&nbsp;import it.polimi.ingsw.gc14.Model.GamePackage.CurrentState;
&nbsp;import it.polimi.ingsw.gc14.Model.MiniModel;
&nbsp;import it.polimi.ingsw.gc14.Model.OrderLogicCard;
&nbsp;import it.polimi.ingsw.gc14.Model.Player;
&nbsp;import it.polimi.ingsw.gc14.Model.Slot;
&nbsp;import it.polimi.ingsw.gc14.Network.EventType;
&nbsp;import it.polimi.ingsw.gc14.Network.NetworkEvent;
&nbsp;
&nbsp;import java.util.ArrayList;
&nbsp;import java.util.List;
&nbsp;import java.util.Map;
&nbsp;
&nbsp;/**
&nbsp; * Network event that transitions all clients to the next round.
&nbsp; *
&nbsp; * &lt;p&gt;Carries refreshed card lists for all four board rows in addition
&nbsp; * to the standard game state (slot map, turn order, current state,
&nbsp; * player list). Only applied client-side; {@link #apply(GameController)}
&nbsp; * always returns {@code false}.
&nbsp; */
&nbsp;public class ApplyNextRound extends NetworkEvent {
&nbsp; /** Tribe cards shown in the upper row of the board for the new round. */
&nbsp; private final ArrayList&lt;TribeCard&gt; upperListTribeCards;
&nbsp; /** Tribe cards shown in the lower row of the board for the new round. */
&nbsp; private final ArrayList&lt;TribeCard&gt; lowerListTribeCards;
&nbsp; /** Building cards shown in the upper row of the board for the new round. */
&nbsp; private final ArrayList&lt;BuildingCard&gt; upperListBuildingCards;
&nbsp; /** Building cards shown in the lower row of the board for the new round. */
&nbsp; private final ArrayList&lt;BuildingCard&gt; lowerListBuildingCards;
&nbsp;
&nbsp;
&nbsp; /**
&nbsp; * Constructs an event that updates the game state for the next round.
&nbsp; *
&nbsp; * @param slotPlayerMap the map associating each slot with the player occupying it.
&nbsp; * @param orderLogicCard the order logic card that determines the player order.
&nbsp; * @param currentState the current state of the game.
&nbsp; * @param players the list of players in the game.
&nbsp; * @param upperListTribeCards the upper row of tribe cards for the new round.
&nbsp; * @param lowerListTribeCards the lower row of tribe cards for the new round.
&nbsp; * @param upperListBuildingCards the upper row of building cards for the new round.
&nbsp; * @param lowerListBuildingCards the lower row of building cards for the new round.
&nbsp; */
&nbsp; public ApplyNextRound(Map&lt;Slot, Player&gt; slotPlayerMap,
&nbsp; OrderLogicCard orderLogicCard,
&nbsp; CurrentState currentState,
&nbsp; List&lt;Player&gt; players,
&nbsp; ArrayList&lt;TribeCard&gt; upperListTribeCards,
&nbsp; ArrayList&lt;TribeCard&gt; lowerListTribeCards,
&nbsp; ArrayList&lt;BuildingCard&gt; upperListBuildingCards,
&nbsp; ArrayList&lt;BuildingCard&gt; lowerListBuildingCards) {
<b class="nc">&nbsp; super(&quot;SERVER&quot;, EventType.NEXT_ROUND, false, ErrorType.WRONG_ACTION);</b>
<b class="nc">&nbsp; setData(slotPlayerMap, orderLogicCard, currentState, players);</b>
<b class="nc">&nbsp; this.upperListBuildingCards = upperListBuildingCards;</b>
<b class="nc">&nbsp; this.lowerListBuildingCards = lowerListBuildingCards;</b>
<b class="nc">&nbsp; this.upperListTribeCards = upperListTribeCards;</b>
<b class="nc">&nbsp; this.lowerListTribeCards = lowerListTribeCards;</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * Not applicable server-side.
&nbsp; *
&nbsp; * @param gameController the game controller (unused).
&nbsp; * @return {@code false} always.
&nbsp; */
&nbsp; @Override
&nbsp; public boolean apply(GameController gameController) {
<b class="nc">&nbsp; return false;</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * Applies this event to the client-side mini model, updating all board lists,
&nbsp; * slot map, turn order, and game state for the new round.
&nbsp; *
&nbsp; * @param miniModel the client-side model to update.
&nbsp; */
&nbsp; @Override
&nbsp; public void apply(MiniModel miniModel) {
<b class="nc">&nbsp; synchronized (miniModel) {</b>
<b class="nc">&nbsp; miniModel.setSlotPlayerMap(slotPlayerMap);</b>
<b class="nc">&nbsp; miniModel.setOrderLogicCard(orderLogicCard);</b>
<b class="nc">&nbsp; miniModel.setCurrentState(currentState);</b>
<b class="nc">&nbsp; miniModel.setPlayers(playerList);</b>
<b class="nc">&nbsp; miniModel.setUpperListTribeCards(upperListTribeCards);</b>
<b class="nc">&nbsp; miniModel.setLowerListTribeCards(lowerListTribeCards);</b>
<b class="nc">&nbsp; miniModel.setUpperListBuildingCards(upperListBuildingCards);</b>
<b class="nc">&nbsp; miniModel.setLowerListBuildingCards(lowerListBuildingCards);</b>
<b class="nc">&nbsp; miniModel.setLastEvent(this);</b>
<b class="nc">&nbsp; }</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>
@@ -0,0 +1,191 @@
<!DOCTYPE html>
<html id="htmlId">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Coverage Report > DisconnectedPlayer</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.Network.NetworkEvents</a>
</div>
<h1>Coverage Summary for Class: DisconnectedPlayer (it.polimi.ingsw.gc14.Network.NetworkEvents)</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">DisconnectedPlayer</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/1)
</span>
</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/4)
</span>
</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/2)
</span>
</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/16)
</span>
</td>
</tr>
</table>
<br/>
<br/>
<pre>
<code class="sourceCode" id="sourceCode">&nbsp;package it.polimi.ingsw.gc14.Network.NetworkEvents;
&nbsp;
&nbsp;import it.polimi.ingsw.gc14.Controller.GameController;
&nbsp;import it.polimi.ingsw.gc14.ErrorType;
&nbsp;import it.polimi.ingsw.gc14.Model.MiniModel;
&nbsp;import it.polimi.ingsw.gc14.Network.EventType;
&nbsp;import it.polimi.ingsw.gc14.Network.NetworkEvent;
&nbsp;
&nbsp;import it.polimi.ingsw.gc14.Model.Game;
&nbsp;import it.polimi.ingsw.gc14.Model.Totems;
&nbsp;
&nbsp;import java.util.ArrayList;
&nbsp;import java.util.List;
&nbsp;
&nbsp;/**
&nbsp; * Network event used to notify all clients that a player has disconnected.
&nbsp; *
&nbsp; * &lt;p&gt;Also carries the updated list of available totems, since a disconnection
&nbsp; * during totem selection may free a totem for other players.
&nbsp; */
&nbsp;public class DisconnectedPlayer extends NetworkEvent {
&nbsp; /** Updated list of totems available after the disconnection frees any previously chosen totem. */
&nbsp; private List&lt;Totems&gt; availableTotems;
&nbsp;
&nbsp;
&nbsp; @Override
&nbsp; public void enrichWithGameState(Game game, ArrayList&lt;String&gt; disconnectedUsernames) {
<b class="nc">&nbsp; super.enrichWithGameState(game, disconnectedUsernames);</b>
<b class="nc">&nbsp; this.availableTotems = game.getAvailableTotems();</b>
<b class="nc">&nbsp; this.disconnectedPlayers = disconnectedUsernames;</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * Constructs a disconnection event for the specified player.
&nbsp; *
&nbsp; * @param username the username of the player who disconnected.
&nbsp; */
&nbsp; public DisconnectedPlayer(String username) {
<b class="nc">&nbsp; super(username, EventType.DISCONNECTED_PLAYER, false, ErrorType.GENERIC_ERROR);</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * Applies this disconnection event to the server-side game controller.
&nbsp; *
&nbsp; * @param gameController the game controller on which to apply the event.
&nbsp; * @return {@code true} if the disconnection is handled successfully.
&nbsp; */
&nbsp; @Override
&nbsp; public boolean apply(GameController gameController){
<b class="nc">&nbsp; return gameController.disconnectedPlayer(username);</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * Applies this disconnection event to the client-side mini model,
&nbsp; * updating player data, turn order, game state, and disconnected player list.
&nbsp; *
&nbsp; * @param miniModel the client-side model to update.
&nbsp; */
&nbsp; @Override
&nbsp; public void apply(MiniModel miniModel){
<b class="nc">&nbsp; synchronized (miniModel) {</b>
<b class="nc">&nbsp; if (isError)</b>
<b class="nc">&nbsp; return;</b>
<b class="nc">&nbsp; miniModel.setPlayers(playerList);</b>
<b class="nc">&nbsp; miniModel.setOrderLogicCard(orderLogicCard);</b>
<b class="nc">&nbsp; miniModel.setCurrentState(currentState);</b>
<b class="nc">&nbsp; miniModel.setSlotPlayerMap(slotPlayerMap);</b>
<b class="nc">&nbsp; miniModel.setDisconnectedPlayers(disconnectedPlayers);</b>
<b class="nc">&nbsp; miniModel.setAvailableTotems(availableTotems);</b>
<b class="nc">&nbsp; miniModel.setLastEvent(this);</b>
<b class="nc">&nbsp; }</b>
&nbsp; }
&nbsp;
&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>
@@ -0,0 +1,175 @@
<!DOCTYPE html>
<html id="htmlId">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Coverage Report > DrawLowerBuildingCard</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.Network.NetworkEvents</a>
</div>
<h1>Coverage Summary for Class: DrawLowerBuildingCard (it.polimi.ingsw.gc14.Network.NetworkEvents)</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">DrawLowerBuildingCard</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/1)
</span>
</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/3)
</span>
</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/2)
</span>
</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/13)
</span>
</td>
</tr>
</table>
<br/>
<br/>
<pre>
<code class="sourceCode" id="sourceCode">&nbsp;package it.polimi.ingsw.gc14.Network.NetworkEvents;
&nbsp;
&nbsp;import it.polimi.ingsw.gc14.Controller.GameController;
&nbsp;import it.polimi.ingsw.gc14.ErrorType;
&nbsp;import it.polimi.ingsw.gc14.Model.MiniModel;
&nbsp;import it.polimi.ingsw.gc14.Network.EventType;
&nbsp;import it.polimi.ingsw.gc14.Network.NetworkEvent;
&nbsp;
&nbsp;
&nbsp;/**
&nbsp; * NetworkEvent to draw a building card from the lower card list.
&nbsp; */
&nbsp;public class DrawLowerBuildingCard extends NetworkEvent{
&nbsp; /** Index of the card to draw */
&nbsp; private final int pos;
&nbsp;
&nbsp; /**
&nbsp; * Class constructor.
&nbsp; * Initializes all the attributes.
&nbsp; * @param username the name of the player requesting the event
&nbsp; * @param pos the index of the card to draw
&nbsp; */
&nbsp; public DrawLowerBuildingCard(String username, int pos){
<b class="nc">&nbsp; super(username, EventType.DRAW_LOWER_BUILD, false, ErrorType.WRONG_ACTION);</b>
<b class="nc">&nbsp; this.pos = pos;</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * @param gameController the Game Controller on which to apply the event
&nbsp; * @return true if the player could draw the card, false otherwise
&nbsp; */
&nbsp; @Override
&nbsp; public boolean apply(GameController gameController){
<b class="nc">&nbsp; return gameController.drawLowerBuildingCard(username, pos);</b>
&nbsp; }
&nbsp;
&nbsp;
&nbsp; /**
&nbsp; * Applies this event to the client-side mini model, removing the drawn card
&nbsp; * from the lower building list and updating players, turn order, game state, and slot map.
&nbsp; *
&nbsp; * @param miniModel the client-side model to update.
&nbsp; */
&nbsp; @Override
&nbsp; public void apply(MiniModel miniModel){
<b class="nc">&nbsp; synchronized (miniModel) {</b>
<b class="nc">&nbsp; if (isError)</b>
<b class="nc">&nbsp; return;</b>
&nbsp;
<b class="nc">&nbsp; miniModel.removeLowerBuildingCard(pos);</b>
<b class="nc">&nbsp; miniModel.setPlayers(playerList);</b>
<b class="nc">&nbsp; miniModel.setOrderLogicCard(orderLogicCard);</b>
<b class="nc">&nbsp; miniModel.setCurrentState(currentState);</b>
<b class="nc">&nbsp; miniModel.setSlotPlayerMap(slotPlayerMap);</b>
<b class="nc">&nbsp; miniModel.setLastEvent(this);</b>
<b class="nc">&nbsp; }</b>
&nbsp; }
&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>
@@ -0,0 +1,174 @@
<!DOCTYPE html>
<html id="htmlId">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Coverage Report > DrawLowerTribeCard</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.Network.NetworkEvents</a>
</div>
<h1>Coverage Summary for Class: DrawLowerTribeCard (it.polimi.ingsw.gc14.Network.NetworkEvents)</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">DrawLowerTribeCard</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/1)
</span>
</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/3)
</span>
</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/2)
</span>
</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/13)
</span>
</td>
</tr>
</table>
<br/>
<br/>
<pre>
<code class="sourceCode" id="sourceCode">&nbsp;package it.polimi.ingsw.gc14.Network.NetworkEvents;
&nbsp;
&nbsp;import it.polimi.ingsw.gc14.Controller.GameController;
&nbsp;import it.polimi.ingsw.gc14.ErrorType;
&nbsp;import it.polimi.ingsw.gc14.Model.MiniModel;
&nbsp;import it.polimi.ingsw.gc14.Network.EventType;
&nbsp;import it.polimi.ingsw.gc14.Network.NetworkEvent;
&nbsp;
&nbsp;
&nbsp;/**
&nbsp; * NetworkEvent to draw a tribe card from the lower card list.
&nbsp; */
&nbsp;public class DrawLowerTribeCard extends NetworkEvent{
&nbsp;
&nbsp; /** Index of the card to draw */
&nbsp; private final int pos;
&nbsp;
&nbsp; /**
&nbsp; * Class constructor.
&nbsp; * Initializes all the attributes.
&nbsp; * @param username the name of the player requesting the event
&nbsp; * @param pos the index of the card to draw
&nbsp; */
&nbsp; public DrawLowerTribeCard(String username, int pos){
<b class="nc">&nbsp; super(username, EventType.DRAW_LOWER_TRIBE, false, ErrorType.WRONG_ACTION);</b>
<b class="nc">&nbsp; this.pos = pos;</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * @param gameController the Game Controller on which to apply the event
&nbsp; * @return true if the player could draw the card, false otherwise
&nbsp; */
&nbsp; @Override
&nbsp; public boolean apply(GameController gameController){
<b class="nc">&nbsp; return gameController.drawLowerTribeCard(username, pos);</b>
&nbsp; }
&nbsp; /**
&nbsp; * Applies this event to the client-side mini model, removing the drawn card
&nbsp; * from the lower tribe list and updating players, turn order, game state, and slot map.
&nbsp; *
&nbsp; * @param miniModel the client-side model to update.
&nbsp; */
&nbsp; @Override
&nbsp; public void apply(MiniModel miniModel){
<b class="nc">&nbsp; synchronized (miniModel) {</b>
<b class="nc">&nbsp; if (isError)</b>
<b class="nc">&nbsp; return;</b>
&nbsp;
<b class="nc">&nbsp; miniModel.removeLowerTribeCard(pos);</b>
<b class="nc">&nbsp; miniModel.setPlayers(playerList);</b>
<b class="nc">&nbsp; miniModel.setOrderLogicCard(orderLogicCard);</b>
<b class="nc">&nbsp; miniModel.setCurrentState(currentState);</b>
<b class="nc">&nbsp; miniModel.setSlotPlayerMap(slotPlayerMap);</b>
<b class="nc">&nbsp; miniModel.setLastEvent(this);</b>
<b class="nc">&nbsp; }</b>
&nbsp; }
&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>
@@ -0,0 +1,174 @@
<!DOCTYPE html>
<html id="htmlId">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Coverage Report > DrawUpperBuildingCard</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.Network.NetworkEvents</a>
</div>
<h1>Coverage Summary for Class: DrawUpperBuildingCard (it.polimi.ingsw.gc14.Network.NetworkEvents)</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">DrawUpperBuildingCard</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/1)
</span>
</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/3)
</span>
</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/2)
</span>
</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/13)
</span>
</td>
</tr>
</table>
<br/>
<br/>
<pre>
<code class="sourceCode" id="sourceCode">&nbsp;package it.polimi.ingsw.gc14.Network.NetworkEvents;
&nbsp;
&nbsp;import it.polimi.ingsw.gc14.Controller.GameController;
&nbsp;import it.polimi.ingsw.gc14.ErrorType;
&nbsp;import it.polimi.ingsw.gc14.Model.MiniModel;
&nbsp;import it.polimi.ingsw.gc14.Network.EventType;
&nbsp;import it.polimi.ingsw.gc14.Network.NetworkEvent;
&nbsp;
&nbsp;
&nbsp;/**
&nbsp; * NetworkEvent to draw a building card from the upper card list.
&nbsp; */
&nbsp;public class DrawUpperBuildingCard extends NetworkEvent{
&nbsp;
&nbsp; /** Index of the card to draw */
&nbsp; private final int pos;
&nbsp;
&nbsp; /**
&nbsp; * Class constructor.
&nbsp; * Initializes all the attributes.
&nbsp; * @param username the name of the player requesting the event
&nbsp; * @param pos the index of the card to draw
&nbsp; */
&nbsp; public DrawUpperBuildingCard(String username, int pos){
<b class="nc">&nbsp; super(username, EventType.DRAW_UPPER_BUILD, false, ErrorType.WRONG_ACTION);</b>
<b class="nc">&nbsp; this.pos = pos;</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * @param gameController the Game Controller on which to apply the event
&nbsp; * @return true if the player could draw the card, false otherwise
&nbsp; */
&nbsp; @Override
&nbsp; public boolean apply(GameController gameController){
<b class="nc">&nbsp; return gameController.drawUpperBuildingCard(username, pos);</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * Applies this event to the client-side mini model, removing the drawn card
&nbsp; * from the upper building list and updating players, turn order, game state, and slot map.
&nbsp; *
&nbsp; * @param miniModel the client-side model to update.
&nbsp; */
&nbsp; @Override
&nbsp; public void apply(MiniModel miniModel){
<b class="nc">&nbsp; synchronized (miniModel) {</b>
<b class="nc">&nbsp; if (isError)</b>
<b class="nc">&nbsp; return;</b>
&nbsp;
<b class="nc">&nbsp; miniModel.removeUpperBuildingCard(pos);</b>
<b class="nc">&nbsp; miniModel.setPlayers(playerList);</b>
<b class="nc">&nbsp; miniModel.setOrderLogicCard(orderLogicCard);</b>
<b class="nc">&nbsp; miniModel.setCurrentState(currentState);</b>
<b class="nc">&nbsp; miniModel.setSlotPlayerMap(slotPlayerMap);</b>
<b class="nc">&nbsp; miniModel.setLastEvent(this);</b>
<b class="nc">&nbsp; }</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>
@@ -0,0 +1,174 @@
<!DOCTYPE html>
<html id="htmlId">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Coverage Report > DrawUpperTribeCard</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.Network.NetworkEvents</a>
</div>
<h1>Coverage Summary for Class: DrawUpperTribeCard (it.polimi.ingsw.gc14.Network.NetworkEvents)</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">DrawUpperTribeCard</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/1)
</span>
</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/3)
</span>
</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/2)
</span>
</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/13)
</span>
</td>
</tr>
</table>
<br/>
<br/>
<pre>
<code class="sourceCode" id="sourceCode">&nbsp;package it.polimi.ingsw.gc14.Network.NetworkEvents;
&nbsp;
&nbsp;import it.polimi.ingsw.gc14.Controller.GameController;
&nbsp;import it.polimi.ingsw.gc14.ErrorType;
&nbsp;import it.polimi.ingsw.gc14.Model.MiniModel;
&nbsp;import it.polimi.ingsw.gc14.Network.EventType;
&nbsp;import it.polimi.ingsw.gc14.Network.NetworkEvent;
&nbsp;
&nbsp;
&nbsp;/**
&nbsp; * NetworkEvent to draw a tribe card from the upper card list.
&nbsp; */
&nbsp;public class DrawUpperTribeCard extends NetworkEvent{
&nbsp;
&nbsp; /** Index of the card to draw */
&nbsp; private final int pos;
&nbsp;
&nbsp; /**
&nbsp; * Class constructor.
&nbsp; * Initializes all the attributes.
&nbsp; * @param username the name of the player requesting the event
&nbsp; * @param pos the index of the card to draw
&nbsp; */
&nbsp; public DrawUpperTribeCard(String username, int pos){
<b class="nc">&nbsp; super(username, EventType.DRAW_UPPER_TRIBE, false, ErrorType.WRONG_ACTION);</b>
<b class="nc">&nbsp; this.pos = pos;</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * @param gameController the Game Controller on which to apply the event
&nbsp; * @return true if the player could draw the card, false otherwise
&nbsp; */
&nbsp; @Override
&nbsp; public boolean apply(GameController gameController){
<b class="nc">&nbsp; return gameController.drawUpperTribeCard(username, pos);</b>
&nbsp; }
&nbsp; /**
&nbsp; * Applies this event to the client-side mini model, removing the drawn card
&nbsp; * from the upper tribe list and updating players, turn order, game state, and slot map.
&nbsp; *
&nbsp; * @param miniModel the client-side model to update.
&nbsp; */
&nbsp; @Override
&nbsp; public void apply(MiniModel miniModel){
<b class="nc">&nbsp; synchronized (miniModel) {</b>
<b class="nc">&nbsp; if (isError)</b>
<b class="nc">&nbsp; return;</b>
<b class="nc">&nbsp; miniModel.removeUpperTribeCard(pos);</b>
<b class="nc">&nbsp; miniModel.setPlayers(playerList);</b>
<b class="nc">&nbsp; miniModel.setOrderLogicCard(orderLogicCard);</b>
<b class="nc">&nbsp; miniModel.setCurrentState(currentState);</b>
<b class="nc">&nbsp; miniModel.setSlotPlayerMap(slotPlayerMap);</b>
<b class="nc">&nbsp; miniModel.setLastEvent(this);</b>
<b class="nc">&nbsp; }</b>
&nbsp; }
&nbsp;
&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>
@@ -0,0 +1,171 @@
<!DOCTYPE html>
<html id="htmlId">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Coverage Report > EndedGame</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.Network.NetworkEvents</a>
</div>
<h1>Coverage Summary for Class: EndedGame (it.polimi.ingsw.gc14.Network.NetworkEvents)</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">EndedGame</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/1)
</span>
</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/3)
</span>
</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/11)
</span>
</td>
</tr>
</table>
<br/>
<br/>
<pre>
<code class="sourceCode" id="sourceCode">&nbsp;package it.polimi.ingsw.gc14.Network.NetworkEvents;
&nbsp;
&nbsp;import it.polimi.ingsw.gc14.Controller.GameController;
&nbsp;import it.polimi.ingsw.gc14.ErrorType;
&nbsp;import it.polimi.ingsw.gc14.Model.GamePackage.CurrentState;
&nbsp;import it.polimi.ingsw.gc14.Model.MiniModel;
&nbsp;import it.polimi.ingsw.gc14.Model.OrderLogicCard;
&nbsp;import it.polimi.ingsw.gc14.Model.Player;
&nbsp;import it.polimi.ingsw.gc14.Model.Slot;
&nbsp;import it.polimi.ingsw.gc14.Network.EventType;
&nbsp;import it.polimi.ingsw.gc14.Network.NetworkEvent;
&nbsp;
&nbsp;import java.util.ArrayList;
&nbsp;import java.util.Map;
&nbsp;
&nbsp;/**
&nbsp; * Network event that signals the end of the game and delivers the final standings.
&nbsp; *
&nbsp; * &lt;p&gt;Only applied client-side; {@link #apply(GameController)} always returns {@code false}.
&nbsp; */
&nbsp;public class EndedGame extends NetworkEvent {
&nbsp;
&nbsp; /**
&nbsp; * Constructs an event containing the final game state.
&nbsp; *
&nbsp; * @param slotPlayerMap the map associating each slot with the player occupying it.
&nbsp; * @param orderLogicCard the order logic card that determines the player order.
&nbsp; * @param currentState the current state of the game.
&nbsp; * @param players the final list of players, used as the standings.
&nbsp; */
&nbsp; public EndedGame(Map&lt;Slot, Player&gt; slotPlayerMap,
&nbsp; OrderLogicCard orderLogicCard,
&nbsp; CurrentState currentState,
&nbsp; ArrayList&lt;Player&gt; players) {
<b class="nc">&nbsp; super(&quot;SERVER&quot;, EventType.ENDED_GAME, false, ErrorType.GENERIC_ERROR);</b>
<b class="nc">&nbsp; setData(slotPlayerMap, orderLogicCard, currentState, players);</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * Not applicable server-side.
&nbsp; *
&nbsp; * @param gameController the game controller (unused).
&nbsp; * @return {@code false} always.
&nbsp; */
&nbsp; @Override
&nbsp; public boolean apply(GameController gameController) {
<b class="nc">&nbsp; return false;</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * Applies this event to the client-side mini model, updating the final
&nbsp; * game state and setting the standings list for the leaderboard.
&nbsp; *
&nbsp; * @param miniModel the client-side model to update.
&nbsp; */
&nbsp; @Override
&nbsp; public void apply(MiniModel miniModel) {
<b class="nc">&nbsp; synchronized (miniModel) {</b>
<b class="nc">&nbsp; miniModel.setSlotPlayerMap(slotPlayerMap);</b>
<b class="nc">&nbsp; miniModel.setOrderLogicCard(orderLogicCard);</b>
<b class="nc">&nbsp; miniModel.setCurrentState(currentState);</b>
<b class="nc">&nbsp; miniModel.setPlayers(playerList);</b>
<b class="nc">&nbsp; miniModel.setStandingPlayers(playerList);</b>
<b class="nc">&nbsp; miniModel.setLastEvent(this);</b>
<b class="nc">&nbsp; }</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>
@@ -0,0 +1,181 @@
<!DOCTYPE html>
<html id="htmlId">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Coverage Report > ReconnectPlayer</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.Network.NetworkEvents</a>
</div>
<h1>Coverage Summary for Class: ReconnectPlayer (it.polimi.ingsw.gc14.Network.NetworkEvents)</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">ReconnectPlayer</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/1)
</span>
</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/4)
</span>
</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/2)
</span>
</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/14)
</span>
</td>
</tr>
</table>
<br/>
<br/>
<pre>
<code class="sourceCode" id="sourceCode">&nbsp;package it.polimi.ingsw.gc14.Network.NetworkEvents;
&nbsp;
&nbsp;import it.polimi.ingsw.gc14.Controller.GameController;
&nbsp;import it.polimi.ingsw.gc14.ErrorType;
&nbsp;import it.polimi.ingsw.gc14.Model.Game;
&nbsp;import it.polimi.ingsw.gc14.Model.MiniModel;
&nbsp;import it.polimi.ingsw.gc14.Network.EventType;
&nbsp;import it.polimi.ingsw.gc14.Network.NetworkEvent;
&nbsp;
&nbsp;import java.util.ArrayList;
&nbsp;
&nbsp;/**
&nbsp; * Network event used to notify that a player has reconnected to the game.
&nbsp; */
&nbsp;public class ReconnectPlayer extends NetworkEvent {
&nbsp;
&nbsp; @Override
&nbsp; public void enrichWithGameState(Game game, ArrayList&lt;String&gt; disconnectedUsernames) {
<b class="nc">&nbsp; super.enrichWithGameState(game, disconnectedUsernames);</b>
<b class="nc">&nbsp; this.disconnectedPlayers = disconnectedUsernames;</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * Constructs a reconnection event for the specified player.
&nbsp; *
&nbsp; * @param username the username of the player who reconnected.
&nbsp; */
&nbsp; public ReconnectPlayer(String username) {
<b class="nc">&nbsp; super(username, EventType.RECONNECT_PLAYER, false, ErrorType.GENERIC_ERROR);</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * Applies the reconnection event to the server-side game controller.
&nbsp; *
&nbsp; * @param gameController the game controller on which to apply the event.
&nbsp; * @return {@code true} if the player reconnection is handled successfully,
&nbsp; * {@code false} otherwise.
&nbsp; */
&nbsp; @Override
&nbsp; public boolean apply(GameController gameController) {
<b class="nc">&nbsp; return gameController.reconnectPlayer(username);</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * Applies the reconnection update to the client-side mini model.
&nbsp; *
&nbsp; * &lt;p&gt;If the event does not represent an error, the player data,
&nbsp; * turn order, current game state, and slot assignments are updated.
&nbsp; *
&nbsp; * @param miniModel the mini model on which to apply the event.
&nbsp; */
&nbsp; @Override
&nbsp; public void apply(MiniModel miniModel) {
<b class="nc">&nbsp; synchronized (miniModel) {</b>
<b class="nc">&nbsp; if (isError)</b>
<b class="nc">&nbsp; return;</b>
<b class="nc">&nbsp; miniModel.setPlayers(playerList);</b>
<b class="nc">&nbsp; miniModel.setOrderLogicCard(orderLogicCard);</b>
<b class="nc">&nbsp; miniModel.setCurrentState(currentState);</b>
<b class="nc">&nbsp; miniModel.setSlotPlayerMap(slotPlayerMap);</b>
<b class="nc">&nbsp; miniModel.setDisconnectedPlayers(disconnectedPlayers);</b>
<b class="nc">&nbsp; miniModel.setLastEvent(this);</b>
<b class="nc">&nbsp; }</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>
@@ -0,0 +1,167 @@
<!DOCTYPE html>
<html id="htmlId">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Coverage Report > SkipTurn</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.Network.NetworkEvents</a>
</div>
<h1>Coverage Summary for Class: SkipTurn (it.polimi.ingsw.gc14.Network.NetworkEvents)</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">SkipTurn</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/1)
</span>
</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/3)
</span>
</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/2)
</span>
</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/11)
</span>
</td>
</tr>
</table>
<br/>
<br/>
<pre>
<code class="sourceCode" id="sourceCode">&nbsp;package it.polimi.ingsw.gc14.Network.NetworkEvents;
&nbsp;
&nbsp;import it.polimi.ingsw.gc14.Controller.GameController;
&nbsp;import it.polimi.ingsw.gc14.ErrorType;
&nbsp;import it.polimi.ingsw.gc14.Model.MiniModel;
&nbsp;import it.polimi.ingsw.gc14.Network.EventType;
&nbsp;import it.polimi.ingsw.gc14.Network.NetworkEvent;
&nbsp;
&nbsp;/**
&nbsp; * Network event used to skip the current player&#39;s optional card action.
&nbsp; */
&nbsp;public class SkipTurn extends NetworkEvent {
&nbsp;
&nbsp; /**
&nbsp; * Class constructor.
&nbsp; * Initializes all the attributes.
&nbsp; * @param username the name of the player requesting the event
&nbsp; */
&nbsp; public SkipTurn(String username){
<b class="nc">&nbsp; super(username, EventType.SKIP_TURN, false, ErrorType.WRONG_ACTION);</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * @param gameController the Game Controller on which to apply the event
&nbsp; * @return true if the player could skipTheTurn, false otherwise
&nbsp; */
&nbsp; @Override
&nbsp; public boolean apply(GameController gameController){
<b class="nc">&nbsp; return gameController.skipTurn(username);</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * Applies this event to the client-side mini model, updating players,
&nbsp; * turn order, game state, and slot map after a skip turn action.
&nbsp; *
&nbsp; * @param miniModel the client-side model to update.
&nbsp; */
&nbsp; @Override
&nbsp; public void apply(MiniModel miniModel){
<b class="nc">&nbsp; synchronized (miniModel) {</b>
<b class="nc">&nbsp; if (isError)</b>
<b class="nc">&nbsp; return;</b>
<b class="nc">&nbsp; miniModel.setPlayers(playerList);</b>
<b class="nc">&nbsp; miniModel.setOrderLogicCard(orderLogicCard);</b>
<b class="nc">&nbsp; miniModel.setCurrentState(currentState);</b>
<b class="nc">&nbsp; miniModel.setSlotPlayerMap(slotPlayerMap);</b>
<b class="nc">&nbsp; miniModel.setLastEvent(this);</b>
<b class="nc">&nbsp; }</b>
&nbsp; }
&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>
@@ -0,0 +1,173 @@
<!DOCTYPE html>
<html id="htmlId">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Coverage Report > SlotChoice</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.Network.NetworkEvents</a>
</div>
<h1>Coverage Summary for Class: SlotChoice (it.polimi.ingsw.gc14.Network.NetworkEvents)</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">SlotChoice</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/1)
</span>
</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/3)
</span>
</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/2)
</span>
</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/12)
</span>
</td>
</tr>
</table>
<br/>
<br/>
<pre>
<code class="sourceCode" id="sourceCode">&nbsp;package it.polimi.ingsw.gc14.Network.NetworkEvents;
&nbsp;
&nbsp;import it.polimi.ingsw.gc14.Controller.GameController;
&nbsp;import it.polimi.ingsw.gc14.ErrorType;
&nbsp;import it.polimi.ingsw.gc14.Model.MiniModel;
&nbsp;import it.polimi.ingsw.gc14.Network.EventType;
&nbsp;import it.polimi.ingsw.gc14.Network.NetworkEvent;
&nbsp;
&nbsp;
&nbsp;/**
&nbsp; * NetworkEvent to select a slot where to place the player totem.
&nbsp; */
&nbsp;public class SlotChoice extends NetworkEvent {
&nbsp;
&nbsp; /** Index of the selected slot. */
&nbsp; private final int pos;
&nbsp;
&nbsp; /**
&nbsp; * Class constructor.
&nbsp; * Initializes all the attributes.
&nbsp; * @param username the name of the player requesting the event
&nbsp; * @param pos the index of the selected slot
&nbsp; */
&nbsp; public SlotChoice(String username, int pos) {
<b class="nc">&nbsp; super(username, EventType.SLOT_CHOICE, false, ErrorType.WRONG_ACTION);</b>
<b class="nc">&nbsp; this.pos = pos;</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * @param gameController the game controller on which to apply the event.
&nbsp; * @return {@code true} if the slot choice is handled successfully, {@code false} otherwise.
&nbsp; */
&nbsp; @Override
&nbsp; public boolean apply(GameController gameController) {
<b class="nc">&nbsp; return gameController.slotChoice(username, pos);</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * Applies this event to the client-side mini model, updating players,
&nbsp; * turn order, game state, and slot map after a slot selection.
&nbsp; *
&nbsp; * @param miniModel the client-side model to update.
&nbsp; */
&nbsp; @Override
&nbsp; public void apply(MiniModel miniModel){
<b class="nc">&nbsp; synchronized (miniModel) {</b>
<b class="nc">&nbsp; if (isError)</b>
<b class="nc">&nbsp; return;</b>
<b class="nc">&nbsp; miniModel.setPlayers(playerList);</b>
<b class="nc">&nbsp; miniModel.setOrderLogicCard(orderLogicCard);</b>
<b class="nc">&nbsp; miniModel.setCurrentState(currentState);</b>
<b class="nc">&nbsp; miniModel.setSlotPlayerMap(slotPlayerMap);</b>
<b class="nc">&nbsp; miniModel.setLastEvent(this);</b>
<b class="nc">&nbsp; }</b>
&nbsp; }
&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>
@@ -0,0 +1,198 @@
<!DOCTYPE html>
<html id="htmlId">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Coverage Report > TotemChoice</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.Network.NetworkEvents</a>
</div>
<h1>Coverage Summary for Class: TotemChoice (it.polimi.ingsw.gc14.Network.NetworkEvents)</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">TotemChoice</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/1)
</span>
</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/4)
</span>
</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/2)
</span>
</td>
<td class="coverageStat">
<span class="percent">
0%
</span>
<span class="absValue">
(0/15)
</span>
</td>
</tr>
</table>
<br/>
<br/>
<pre>
<code class="sourceCode" id="sourceCode">&nbsp;package it.polimi.ingsw.gc14.Network.NetworkEvents;
&nbsp;
&nbsp;import it.polimi.ingsw.gc14.Controller.GameController;
&nbsp;import it.polimi.ingsw.gc14.ErrorType;
&nbsp;import it.polimi.ingsw.gc14.Model.Game;
&nbsp;import it.polimi.ingsw.gc14.Model.MiniModel;
&nbsp;import it.polimi.ingsw.gc14.Model.Totems;
&nbsp;import it.polimi.ingsw.gc14.Network.EventType;
&nbsp;import it.polimi.ingsw.gc14.Network.NetworkEvent;
&nbsp;
&nbsp;import java.io.Serializable;
&nbsp;import java.util.ArrayList;
&nbsp;import java.util.List;
&nbsp;
&nbsp;/**
&nbsp; * Network event used to handle a player&#39;s totem choice.
&nbsp; */
&nbsp;public class TotemChoice extends NetworkEvent implements Serializable {
&nbsp;
&nbsp; /**
&nbsp; * Name of the totem selected by the player.
&nbsp; */
&nbsp; private final String totem;
&nbsp;
&nbsp; /**
&nbsp; * List of totems still available after the choice has been processed.
&nbsp; */
&nbsp; private List&lt;Totems&gt; availableTotems;
&nbsp;
&nbsp; /**
&nbsp; * Constructs a totem choice event for the specified player.
&nbsp; *
&nbsp; * @param username the username of the player making the choice.
&nbsp; * @param totem the name of the selected totem.
&nbsp; */
&nbsp; public TotemChoice(String username, String totem) {
<b class="nc">&nbsp; super(username, EventType.TOTEM_CHOICE, false, ErrorType.WRONG_ACTION);</b>
<b class="nc">&nbsp; this.totem = totem;</b>
&nbsp; }
&nbsp;
&nbsp; @Override
&nbsp; public void enrichWithGameState(Game game, ArrayList&lt;String&gt; disconnectedUsernames) {
<b class="nc">&nbsp; super.enrichWithGameState(game, disconnectedUsernames);</b>
<b class="nc">&nbsp; this.availableTotems = game.getAvailableTotems();</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * Applies the totem choice event to the server-side game controller.
&nbsp; *
&nbsp; * @param gameController the game controller on which to apply the event.
&nbsp; * @return {@code true} if the totem choice is handled successfully,
&nbsp; * {@code false} otherwise.
&nbsp; */
&nbsp; @Override
&nbsp; public boolean apply(GameController gameController) {
<b class="nc">&nbsp; return gameController.totemChoice(username, totem);</b>
&nbsp; }
&nbsp;
&nbsp; /**
&nbsp; * Applies the totem choice update to the client-side mini model.
&nbsp; *
&nbsp; * &lt;p&gt;If the event does not represent an error, the player data,
&nbsp; * turn order, current game state, slot assignments, and available
&nbsp; * totems are updated.
&nbsp; *
&nbsp; * @param miniModel the mini model on which to apply the event.
&nbsp; */
&nbsp; @Override
&nbsp; public void apply(MiniModel miniModel) {
<b class="nc">&nbsp; synchronized (miniModel) {</b>
<b class="nc">&nbsp; if (isError)</b>
<b class="nc">&nbsp; return;</b>
&nbsp;
<b class="nc">&nbsp; miniModel.setPlayers(playerList);</b>
<b class="nc">&nbsp; miniModel.setOrderLogicCard(orderLogicCard);</b>
<b class="nc">&nbsp; miniModel.setCurrentState(currentState);</b>
<b class="nc">&nbsp; miniModel.setSlotPlayerMap(slotPlayerMap);</b>
<b class="nc">&nbsp; miniModel.setAvailableTotems(availableTotems);</b>
<b class="nc">&nbsp; miniModel.setLastEvent(this);</b>
<b class="nc">&nbsp; }</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>