Files
Progetto-ingegneria-del-sof…/deliverables/Coverage/htmReport/ns-d/sources/source-8.html
T
2026-06-19 22:57:43 +02:00

172 lines
4.8 KiB
HTML

<!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>