Files
2026-06-19 23:09:49 +02:00

550 lines
34 KiB
HTML

<!DOCTYPE HTML>
<html lang="it">
<head>
<!-- Generated by javadoc (25) on Fri Jun 19 23:05:23 CEST 2026 -->
<title>ClientController</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="dc.created" content="2026-06-19">
<meta name="description" content="declaration: module: it.polimi.ingsw.gc14, package: it.polimi.ingsw.gc14.Controller, class: ClientController">
<meta name="generator" content="javadoc/ClassWriter">
<link rel="stylesheet" type="text/css" href="../../../../../../resource-files/jquery-ui.min.css">
<link rel="stylesheet" type="text/css" href="../../../../../../resource-files/stylesheet.css">
<script type="text/javascript" src="../../../../../../script-files/script.js"></script>
<script type="text/javascript" src="../../../../../../script-files/jquery-3.7.1.min.js"></script>
<script type="text/javascript" src="../../../../../../script-files/jquery-ui.min.js"></script>
</head>
<body class="class-declaration-page">
<script type="text/javascript">const pathtoroot = "../../../../../../";
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="top-nav" id="navbar-top">
<div class="nav-content">
<div class="nav-menu-button"><button id="navbar-toggle-button" aria-controls="navbar-top" aria-expanded="false" aria-label="Toggle navigation links"><span class="nav-bar-toggle-icon">&nbsp;</span><span class="nav-bar-toggle-icon">&nbsp;</span><span class="nav-bar-toggle-icon">&nbsp;</span></button></div>
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
<li><a href="../../../../../module-summary.html">Module</a></li>
<li class="nav-bar-cell1-rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../../search.html">Search</a></li>
<li><a href="../../../../../../help-doc.html#class">Help</a></li>
</ul>
</div>
</div>
<div class="sub-nav">
<div class="nav-content">
<ol class="sub-nav-list">
<li><a href="../../../../../module-summary.html">it.polimi.ingsw.gc14</a></li>
<li><a href="package-summary.html">it.polimi.ingsw.gc14.Controller</a></li>
<li><a href="ClientController.html" class="current-selection">ClientController</a></li>
</ol>
<div class="nav-list-search"><input type="text" id="search-input" disabled placeholder="Search documentation (type /)" aria-label="Search in documentation" autocomplete="off" spellcheck="false"><input type="reset" id="reset-search" disabled value="Reset"></div>
</div>
</div>
<!-- ========= END OF TOP NAVBAR ========= -->
<span class="skip-nav" id="skip-navbar-top"></span></nav>
</header>
<div class="main-grid">
<nav role="navigation" class="toc" aria-label="Table of contents">
<div class="toc-header">Contents&nbsp;<input type="text" class="filter-input" disabled placeholder="Filter contents (type .)" aria-label="Filter table of contents" autocomplete="off" spellcheck="false"><input type="reset" class="reset-filter" disabled tabindex="-1" value="Reset"></div>
<ol class="toc-list" tabindex="-1">
<li><a href="#" tabindex="0">Description</a></li>
<li><a href="#field-summary" tabindex="0">Field Summary</a></li>
<li><a href="#constructor-summary" tabindex="0">Constructor Summary</a></li>
<li><a href="#method-summary" tabindex="0">Method Summary</a></li>
<li><a href="#field-detail" tabindex="0">Field Details</a>
<ol class="toc-list">
<li><a href="#miniModel" tabindex="0">miniModel</a></li>
<li><a href="#view" tabindex="0">view</a></li>
<li><a href="#client" tabindex="0">client</a></li>
<li><a href="#myUsername" tabindex="0">myUsername</a></li>
</ol>
</li>
<li><a href="#constructor-detail" tabindex="0">Constructor Details</a>
<ol class="toc-list">
<li><a href="#%3Cinit%3E(it.polimi.ingsw.gc14.View.IView)" tabindex="0">ClientController(IView)</a></li>
</ol>
</li>
<li><a href="#method-detail" tabindex="0">Method Details</a>
<ol class="toc-list">
<li><a href="#getMiniModel()" tabindex="0">getMiniModel()</a></li>
<li><a href="#getView()" tabindex="0">getView()</a></li>
<li><a href="#getMyUsername()" tabindex="0">getMyUsername()</a></li>
<li><a href="#setClient(it.polimi.ingsw.gc14.Network.IClient)" tabindex="0">setClient(IClient)</a></li>
<li><a href="#getClient()" tabindex="0">getClient()</a></li>
<li><a href="#setModel(it.polimi.ingsw.gc14.Model.MiniModel)" tabindex="0">setModel(MiniModel)</a></li>
<li><a href="#setMyUsername(java.lang.String)" tabindex="0">setMyUsername(String)</a></li>
<li><a href="#drawUpperTribeCard(int)" tabindex="0">drawUpperTribeCard(int)</a></li>
<li><a href="#drawLowerTribeCard(int)" tabindex="0">drawLowerTribeCard(int)</a></li>
<li><a href="#drawUpperBuildingCard(int)" tabindex="0">drawUpperBuildingCard(int)</a></li>
<li><a href="#drawLowerBuildingCard(int)" tabindex="0">drawLowerBuildingCard(int)</a></li>
<li><a href="#skipTurn()" tabindex="0">skipTurn()</a></li>
<li><a href="#slotChoice(int)" tabindex="0">slotChoice(int)</a></li>
<li><a href="#totemChoice(int)" tabindex="0">totemChoice(int)</a></li>
<li><a href="#disconnect()" tabindex="0">disconnect()</a></li>
</ol>
</li>
</ol>
<button class="hide-sidebar"><span>Hide sidebar&nbsp;</span><img src="../../../../../../resource-files/left.svg" alt="Hide sidebar"></button><button class="show-sidebar"><img src="../../../../../../resource-files/right.svg" alt="Show sidebar"><span>&nbsp;Show sidebar</span></button></nav>
<main role="main">
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<h1 title="Class ClientController" class="title">Class ClientController</h1>
</div>
<div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">java.lang.Object</a>
<div class="inheritance">it.polimi.ingsw.gc14.Controller.ClientController</div>
</div>
<section class="class-description" id="class-description">
<hr>
<div class="horizontal-scroll">
<div class="type-signature"><span class="modifiers">public class </span><span class="element-name type-name-label">ClientController</span>
<span class="extends-implements">extends <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></span></div>
<div class="block">Controller responsible for coordinating the client-side components,
including the view, the network client and the local mini model.
<p>It receives user actions from the view, performs basic client-side
checks and forwards valid requests to the network client.</div>
</div>
</section>
<section class="summary">
<ul class="summary-list">
<!-- =========== FIELD SUMMARY =========== -->
<li>
<section class="field-summary" id="field-summary">
<h2>Field Summary</h2>
<div class="caption"><span>Fields</span></div>
<div class="summary-table three-column-summary">
<div class="table-header col-first">Modifier and Type</div>
<div class="table-header col-second">Field</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color"><code>private <a href="../Network/IClient.html" title="interface in it.polimi.ingsw.gc14.Network">IClient</a></code></div>
<div class="col-second even-row-color"><code><a href="#client" class="member-name-link">client</a></code></div>
<div class="col-last even-row-color">
<div class="block">Network client, either TCP or RMI.</div>
</div>
<div class="col-first odd-row-color"><code>private <a href="../Model/MiniModel.html" title="class in it.polimi.ingsw.gc14.Model">MiniModel</a></code></div>
<div class="col-second odd-row-color"><code><a href="#miniModel" class="member-name-link">miniModel</a></code></div>
<div class="col-last odd-row-color">
<div class="block">Local mini model representing the client-side game state.</div>
</div>
<div class="col-first even-row-color"><code>private <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
<div class="col-second even-row-color"><code><a href="#myUsername" class="member-name-link">myUsername</a></code></div>
<div class="col-last even-row-color">
<div class="block">Username associated with this client.</div>
</div>
<div class="col-first odd-row-color"><code>private final <a href="../View/IView.html" title="interface in it.polimi.ingsw.gc14.View">IView</a></code></div>
<div class="col-second odd-row-color"><code><a href="#view" class="member-name-link">view</a></code></div>
<div class="col-last odd-row-color">
<div class="block">View of the client.</div>
</div>
</div>
</section>
</li>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<li>
<section class="constructor-summary" id="constructor-summary">
<h2>Constructor Summary</h2>
<div class="caption"><span>Constructors</span></div>
<div class="summary-table two-column-summary">
<div class="table-header col-first">Constructor</div>
<div class="table-header col-last">Description</div>
<div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E(it.polimi.ingsw.gc14.View.IView)" class="member-name-link">ClientController</a><wbr>(<a href="../View/IView.html" title="interface in it.polimi.ingsw.gc14.View">IView</a>&nbsp;view)</code></div>
<div class="col-last even-row-color">
<div class="block">Constructs a client controller with the specified view.</div>
</div>
</div>
</section>
</li>
<!-- ========== METHOD SUMMARY =========== -->
<li>
<section class="method-summary" id="method-summary">
<h2>Method Summary</h2>
<div id="method-summary-table">
<div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div>
<div id="method-summary-table.tabpanel" role="tabpanel" aria-labelledby="method-summary-table-tab0">
<div class="summary-table three-column-summary">
<div class="table-header col-first">Modifier and Type</div>
<div class="table-header col-second">Method</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#disconnect()" class="member-name-link">disconnect</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Notifies the server of a voluntary disconnection and closes the
network client connection.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#drawLowerBuildingCard(int)" class="member-name-link">drawLowerBuildingCard</a><wbr>(int&nbsp;pos)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Requests to draw a building card from the lower list.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#drawLowerTribeCard(int)" class="member-name-link">drawLowerTribeCard</a><wbr>(int&nbsp;pos)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Requests to draw a tribe card from the lower list.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#drawUpperBuildingCard(int)" class="member-name-link">drawUpperBuildingCard</a><wbr>(int&nbsp;pos)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Requests to draw a building card from the upper list.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#drawUpperTribeCard(int)" class="member-name-link">drawUpperTribeCard</a><wbr>(int&nbsp;pos)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Requests to draw a tribe card from the upper list.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="../Network/IClient.html" title="interface in it.polimi.ingsw.gc14.Network">IClient</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getClient()" class="member-name-link">getClient</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Gets the network client.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="../Model/MiniModel.html" title="class in it.polimi.ingsw.gc14.Model">MiniModel</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getMiniModel()" class="member-name-link">getMiniModel</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns the local mini model.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getMyUsername()" class="member-name-link">getMyUsername</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns the username associated with this client.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="../View/IView.html" title="interface in it.polimi.ingsw.gc14.View">IView</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getView()" class="member-name-link">getView</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns the client view.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setClient(it.polimi.ingsw.gc14.Network.IClient)" class="member-name-link">setClient</a><wbr>(<a href="../Network/IClient.html" title="interface in it.polimi.ingsw.gc14.Network">IClient</a>&nbsp;client)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Sets the network client.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setModel(it.polimi.ingsw.gc14.Model.MiniModel)" class="member-name-link">setModel</a><wbr>(<a href="../Model/MiniModel.html" title="class in it.polimi.ingsw.gc14.Model">MiniModel</a>&nbsp;model)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Sets the local mini model and updates the view accordingly.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setMyUsername(java.lang.String)" class="member-name-link">setMyUsername</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;username)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Sets the username associated with this client.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#skipTurn()" class="member-name-link">skipTurn</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Requests to skip the current turn.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#slotChoice(int)" class="member-name-link">slotChoice</a><wbr>(int&nbsp;pos)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Requests the selection of a slot by the specified player.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#totemChoice(int)" class="member-name-link">totemChoice</a><wbr>(int&nbsp;pos)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Handles the selection of a totem by the specified player.</div>
</div>
</div>
</div>
</div>
<div class="inherited-list">
<h3 id="methods-inherited-from-class-java.lang.Object">Methods inherited from class&nbsp;<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#method-summary" title="class or interface in java.lang" class="external-link">Object</a></h3>
<code><a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#clone()" title="class or interface in java.lang" class="external-link">clone</a>, <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#finalize()" title="class or interface in java.lang" class="external-link">finalize</a>, <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hashCode</a>, <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">toString</a>, <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div>
</section>
</li>
</ul>
</section>
<section class="details">
<ul class="details-list">
<!-- ============ FIELD DETAIL =========== -->
<li>
<section class="field-details" id="field-detail">
<h2>Field Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="miniModel">
<h3>miniModel</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">private</span>&nbsp;<span class="return-type"><a href="../Model/MiniModel.html" title="class in it.polimi.ingsw.gc14.Model">MiniModel</a></span>&nbsp;<span class="element-name">miniModel</span></div>
<div class="block">Local mini model representing the client-side game state.</div>
</div>
</section>
</li>
<li>
<section class="detail" id="view">
<h3>view</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">private final</span>&nbsp;<span class="return-type"><a href="../View/IView.html" title="interface in it.polimi.ingsw.gc14.View">IView</a></span>&nbsp;<span class="element-name">view</span></div>
<div class="block">View of the client.</div>
</div>
</section>
</li>
<li>
<section class="detail" id="client">
<h3>client</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">private</span>&nbsp;<span class="return-type"><a href="../Network/IClient.html" title="interface in it.polimi.ingsw.gc14.Network">IClient</a></span>&nbsp;<span class="element-name">client</span></div>
<div class="block">Network client, either TCP or RMI.</div>
</div>
</section>
</li>
<li>
<section class="detail" id="myUsername">
<h3>myUsername</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">private</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span>&nbsp;<span class="element-name">myUsername</span></div>
<div class="block">Username associated with this client.</div>
</div>
</section>
</li>
</ul>
</section>
</li>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<li>
<section class="constructor-details" id="constructor-detail">
<h2>Constructor Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="&lt;init&gt;(it.polimi.ingsw.gc14.View.IView)">
<h3>ClientController</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">ClientController</span><wbr><span class="parameters">(<a href="../View/IView.html" title="interface in it.polimi.ingsw.gc14.View">IView</a>&nbsp;view)</span></div>
<div class="block">Constructs a client controller with the specified view.
<p>The network client is initially unset and an empty local mini model
is created.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>view</code> - the client view, either TUI or GUI.</dd>
</dl>
</div>
</section>
</li>
</ul>
</section>
</li>
<!-- ============ METHOD DETAIL ========== -->
<li>
<section class="method-details" id="method-detail">
<h2>Method Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="getMiniModel()">
<h3>getMiniModel</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="../Model/MiniModel.html" title="class in it.polimi.ingsw.gc14.Model">MiniModel</a></span>&nbsp;<span class="element-name">getMiniModel</span>()</div>
<div class="block">Returns the local mini model.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>the local mini model.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="getView()">
<h3>getView</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="../View/IView.html" title="interface in it.polimi.ingsw.gc14.View">IView</a></span>&nbsp;<span class="element-name">getView</span>()</div>
<div class="block">Returns the client view.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>the client view.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="getMyUsername()">
<h3>getMyUsername</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span>&nbsp;<span class="element-name">getMyUsername</span>()</div>
<div class="block">Returns the username associated with this client.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>the username.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="setClient(it.polimi.ingsw.gc14.Network.IClient)">
<h3>setClient</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setClient</span><wbr><span class="parameters">(<a href="../Network/IClient.html" title="interface in it.polimi.ingsw.gc14.Network">IClient</a>&nbsp;client)</span></div>
<div class="block">Sets the network client.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>client</code> - the client to set, either TCP or RMI.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="getClient()">
<h3>getClient</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="../Network/IClient.html" title="interface in it.polimi.ingsw.gc14.Network">IClient</a></span>&nbsp;<span class="element-name">getClient</span>()</div>
<div class="block">Gets the network client.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>client return the client, either TCP or RMI.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="setModel(it.polimi.ingsw.gc14.Model.MiniModel)">
<h3>setModel</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setModel</span><wbr><span class="parameters">(<a href="../Model/MiniModel.html" title="class in it.polimi.ingsw.gc14.Model">MiniModel</a>&nbsp;model)</span></div>
<div class="block">Sets the local mini model and updates the view accordingly.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>model</code> - the mini model to set.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="setMyUsername(java.lang.String)">
<h3>setMyUsername</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setMyUsername</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;username)</span></div>
<div class="block">Sets the username associated with this client.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>username</code> - the username to set.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="drawUpperTribeCard(int)">
<h3>drawUpperTribeCard</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">drawUpperTribeCard</span><wbr><span class="parameters">(int&nbsp;pos)</span></div>
<div class="block">Requests to draw a tribe card from the upper list.
<p>The request is forwarded to the network client; the server validates it.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>pos</code> - the index of the card to draw.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="drawLowerTribeCard(int)">
<h3>drawLowerTribeCard</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">drawLowerTribeCard</span><wbr><span class="parameters">(int&nbsp;pos)</span></div>
<div class="block">Requests to draw a tribe card from the lower list.
<p>The request is forwarded to the network client; the server validates it.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>pos</code> - the index of the card to draw.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="drawUpperBuildingCard(int)">
<h3>drawUpperBuildingCard</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">drawUpperBuildingCard</span><wbr><span class="parameters">(int&nbsp;pos)</span></div>
<div class="block">Requests to draw a building card from the upper list.
<p>The request is forwarded to the network client; the server validates it.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>pos</code> - the index of the card to draw.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="drawLowerBuildingCard(int)">
<h3>drawLowerBuildingCard</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">drawLowerBuildingCard</span><wbr><span class="parameters">(int&nbsp;pos)</span></div>
<div class="block">Requests to draw a building card from the lower list.
<p>The request is forwarded to the network client; the server validates it.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>pos</code> - the index of the card to draw.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="skipTurn()">
<h3>skipTurn</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">skipTurn</span>()</div>
<div class="block">Requests to skip the current turn.
<p>The request is forwarded to the network client; the server validates it.</div>
</div>
</section>
</li>
<li>
<section class="detail" id="slotChoice(int)">
<h3>slotChoice</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">slotChoice</span><wbr><span class="parameters">(int&nbsp;pos)</span></div>
<div class="block">Requests the selection of a slot by the specified player.
<p>The request is forwarded to the network client; the server validates it.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>pos</code> - the index of the selected slot.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="totemChoice(int)">
<h3>totemChoice</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">totemChoice</span><wbr><span class="parameters">(int&nbsp;pos)</span></div>
<div class="block">Handles the selection of a totem by the specified player.
<p>If the specified player is not the current player, an error message
is shown. Otherwise, the selected totem is retrieved from the available
totems list and the choice is forwarded to the network client.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>pos</code> - the index of the selected totem in the available totems list.</dd>
</dl>
</div>
</section>
</li>
<li>
<section class="detail" id="disconnect()">
<h3>disconnect</h3>
<div class="horizontal-scroll">
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">disconnect</span>()</div>
<div class="block">Notifies the server of a voluntary disconnection and closes the
network client connection.</div>
</div>
</section>
</li>
</ul>
</section>
</li>
</ul>
</section>
<!-- ========= END OF CLASS DATA ========= -->
</main>
</div>
</body>
</html>