201 lines
6.9 KiB
HTML
201 lines
6.9 KiB
HTML
|
|
|
|
|
|
<!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/19)
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<br/>
|
|
<br/>
|
|
|
|
|
|
<pre>
|
|
<code class="sourceCode" id="sourceCode"> package it.polimi.ingsw.gc14.Network.NetworkEvents;
|
|
|
|
import it.polimi.ingsw.gc14.Controller.GameController;
|
|
import it.polimi.ingsw.gc14.ErrorType;
|
|
import it.polimi.ingsw.gc14.Model.Cards.BuildingCard;
|
|
import it.polimi.ingsw.gc14.Model.Cards.TribeCard;
|
|
import it.polimi.ingsw.gc14.Model.GamePackage.CurrentState;
|
|
import it.polimi.ingsw.gc14.Model.MiniModel;
|
|
import it.polimi.ingsw.gc14.Model.OrderLogicCard;
|
|
import it.polimi.ingsw.gc14.Model.Player;
|
|
import it.polimi.ingsw.gc14.Model.Slot;
|
|
import it.polimi.ingsw.gc14.Network.EventType;
|
|
import it.polimi.ingsw.gc14.Network.NetworkEvent;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
/**
|
|
* Network event that transitions all clients to the next round.
|
|
*
|
|
* <p>Carries refreshed card lists for all four board rows in addition
|
|
* to the standard game state (slot map, turn order, current state,
|
|
* player list). Only applied client-side; {@link #apply(GameController)}
|
|
* always returns {@code false}.
|
|
*/
|
|
public class ApplyNextRound extends NetworkEvent {
|
|
|
|
private ArrayList<TribeCard> upperListTribeCards;
|
|
private ArrayList<TribeCard> lowerListTribeCards;
|
|
private ArrayList<BuildingCard> upperListBuildingCards;
|
|
private ArrayList<BuildingCard> lowerListBuildingCards;
|
|
|
|
|
|
/**
|
|
* Constructs an event that updates the game state for the next round.
|
|
*
|
|
* @param slotPlayerMap the map associating each slot with the player occupying it.
|
|
* @param orderLogicCard the order logic card that determines the player order.
|
|
* @param currentState the current state of the game.
|
|
* @param players the list of players in the game.
|
|
* @param upperListTribeCards the upper row of tribe cards for the new round.
|
|
* @param lowerListTribeCards the lower row of tribe cards for the new round.
|
|
* @param upperListBuildingCards the upper row of building cards for the new round.
|
|
* @param lowerListBuildingCards the lower row of building cards for the new round.
|
|
*/
|
|
public ApplyNextRound(Map<Slot, Player> slotPlayerMap,
|
|
OrderLogicCard orderLogicCard,
|
|
CurrentState currentState,
|
|
List<Player> players,
|
|
ArrayList<TribeCard> upperListTribeCards,
|
|
ArrayList<TribeCard> lowerListTribeCards,
|
|
ArrayList<BuildingCard> upperListBuildingCards,
|
|
ArrayList<BuildingCard> lowerListBuildingCards) {
|
|
<b class="nc"> super("SERVER", EventType.NEXT_ROUND, false, ErrorType.WRONG_ACTION);</b>
|
|
<b class="nc"> setData(slotPlayerMap, orderLogicCard, currentState, players);</b>
|
|
<b class="nc"> this.upperListBuildingCards = upperListBuildingCards;</b>
|
|
<b class="nc"> this.lowerListBuildingCards = lowerListBuildingCards;</b>
|
|
<b class="nc"> this.upperListTribeCards = upperListTribeCards;</b>
|
|
<b class="nc"> this.lowerListTribeCards = lowerListTribeCards;</b>
|
|
}
|
|
|
|
/**
|
|
* Not applicable server-side.
|
|
*
|
|
* @param gameController the game controller (unused).
|
|
* @return {@code false} always.
|
|
*/
|
|
@Override
|
|
public boolean apply(GameController gameController) {
|
|
<b class="nc"> return false;</b>
|
|
}
|
|
|
|
/**
|
|
* Applies this event to the client-side mini model, updating all board lists,
|
|
* slot map, turn order, and game state for the new round.
|
|
*
|
|
* @param miniModel the client-side model to update.
|
|
* @return {@code true} always (this event cannot produce an error).
|
|
*/
|
|
@Override
|
|
public boolean apply(MiniModel miniModel) {
|
|
<b class="nc"> synchronized (miniModel) {</b>
|
|
<b class="nc"> miniModel.setSlotPlayerMap(slotPlayerMap);</b>
|
|
<b class="nc"> miniModel.setOrderLogicCard(orderLogicCard);</b>
|
|
<b class="nc"> miniModel.setCurrentState(currentState);</b>
|
|
<b class="nc"> miniModel.setPlayers(playerList);</b>
|
|
<b class="nc"> miniModel.setUpperListTribeCards(upperListTribeCards);</b>
|
|
<b class="nc"> miniModel.setLowerListTribeCards(lowerListTribeCards);</b>
|
|
<b class="nc"> miniModel.setUpperListBuildingCards(upperListBuildingCards);</b>
|
|
<b class="nc"> miniModel.setLowerListBuildingCards(lowerListBuildingCards);</b>
|
|
<b class="nc"> miniModel.setLastEvent(this);</b>
|
|
<b class="nc"> return true;</b>
|
|
<b class="nc"> }</b>
|
|
}
|
|
}
|
|
</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>
|