Skip to content

Commit 3ec699e

Browse files
committed
chore: whitespace fixes
1 parent 9189356 commit 3ec699e

File tree

11 files changed

+139
-110
lines changed

11 files changed

+139
-110
lines changed

Assets/Scripts/ConnectionManagement/ConnectionMethod.cs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
namespace Unity.BossRoom.ConnectionManagement
1010
{
1111
/// <summary>
12-
/// ConnectionMethod contains all setup needed to setup NGO to be ready to start a connection, either host or client side.
13-
/// Please override this abstract class to add a new transport or way of connecting.
12+
/// ConnectionMethod contains all setup needed to setup NGO to be ready to start a connection, either host or client
13+
/// side.
14+
/// Please override this abstract class to add a new transport or way of connecting.
1415
/// </summary>
1516
public abstract class ConnectionMethodBase
1617
{
@@ -19,23 +20,23 @@ public abstract class ConnectionMethodBase
1920
protected readonly string m_PlayerName;
2021

2122
/// <summary>
22-
/// Setup the host connection prior to starting the NetworkManager
23+
/// Setup the host connection prior to starting the NetworkManager
2324
/// </summary>
2425
/// <returns></returns>
2526
public abstract Task SetupHostConnectionAsync();
26-
27+
2728
/// <summary>
28-
/// Setup the client connection prior to starting the NetworkManager
29+
/// Setup the client connection prior to starting the NetworkManager
2930
/// </summary>
3031
/// <returns></returns>
3132
public abstract void SetupClientConnectionAsync();
3233

3334
/// <summary>
34-
/// Setup the client for reconnection prior to reconnecting
35+
/// Setup the client for reconnection prior to reconnecting
3536
/// </summary>
3637
/// <returns>
37-
/// success = true if succeeded in setting up reconnection, false if failed.
38-
/// shouldTryAgain = true if we should try again after failing, false if not.
38+
/// success = true if succeeded in setting up reconnection, false if failed.
39+
/// shouldTryAgain = true if we should try again after failing, false if not.
3940
/// </returns>
4041
public abstract Task<(bool success, bool shouldTryAgain)> SetupClientReconnectionAsync();
4142

@@ -79,7 +80,7 @@ protected string GetPlayerId()
7980
}
8081

8182
/// <summary>
82-
/// Simple IP connection setup with UTP
83+
/// Simple IP connection setup with UTP
8384
/// </summary>
8485
class ConnectionMethodIP : ConnectionMethodBase
8586
{
@@ -116,7 +117,7 @@ public override async Task SetupHostConnectionAsync()
116117
}
117118

118119
/// <summary>
119-
/// UTP's Relay connection setup using the Session integration
120+
/// UTP's Relay connection setup using the Session integration
120121
/// </summary>
121122
class ConnectionMethodRelay : ConnectionMethodBase
122123
{

Assets/Scripts/ConnectionManagement/ConnectionState/ConnectionState.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
namespace Unity.BossRoom.ConnectionManagement
88
{
99
/// <summary>
10-
/// Base class representing a connection state.
10+
/// Base class representing a connection state.
1111
/// </summary>
1212
abstract class ConnectionState
1313
{
@@ -27,11 +27,11 @@ public virtual void OnClientDisconnect(ulong clientId) { }
2727
public virtual void OnServerStarted() { }
2828

2929
public virtual void StartClientIP(string playerName, string ipaddress, int port) { }
30-
30+
3131
public virtual void StartClientSession(string playerName) { }
3232

3333
public virtual void StartHostIP(string playerName, string ipaddress, int port) { }
34-
34+
3535
public virtual void StartHostSession(string playerName) { }
3636

3737
public virtual void OnUserRequestedShutdown() { }

Assets/Scripts/ConnectionManagement/ConnectionState/OfflineState.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
namespace UUnity.BossRoom.ConnectionManagement
1111
{
1212
/// <summary>
13-
/// Connection state corresponding to when the NetworkManager is shut down. From this state we can transition to the
14-
/// ClientConnecting sate, if starting as a client, or the StartingHost state, if starting as a host.
13+
/// Connection state corresponding to when the NetworkManager is shut down. From this state we can transition to the
14+
/// ClientConnecting sate, if starting as a client, or the StartingHost state, if starting as a host.
1515
/// </summary>
1616
class OfflineState : ConnectionState
1717
{
@@ -35,7 +35,7 @@ public override void Enter()
3535
}
3636

3737
public override void Exit() { }
38-
38+
3939
public override void OnClientConnected(ulong _)
4040
{
4141
m_ConnectStatusPublisher.Publish(ConnectStatus.Success);

Assets/Scripts/ConnectionManagement/ConnectionState/StartingHostState.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
namespace Unity.BossRoom.ConnectionManagement
1010
{
1111
/// <summary>
12-
/// Connection state corresponding to a host starting up. Starts the host when entering the state. If successful,
13-
/// transitions to the Hosting state, if not, transitions back to the Offline state.
12+
/// Connection state corresponding to a host starting up. Starts the host when entering the state. If successful,
13+
/// transitions to the Hosting state, if not, transitions back to the Offline state.
1414
/// </summary>
1515
class StartingHostState : OnlineState
1616
{
@@ -43,6 +43,7 @@ public override void ApprovalCheck(NetworkManager.ConnectionApprovalRequest requ
4343
{
4444
var connectionData = request.Payload;
4545
var clientId = request.ClientNetworkId;
46+
4647
// This happens when starting as a host, before the end of the StartHost call. In that case, we simply approve ourselves.
4748
if (clientId == m_ConnectionManager.NetworkManager.LocalClientId)
4849
{
@@ -75,7 +76,7 @@ async void StartHost()
7576
if (!m_ConnectionManager.NetworkManager.StartHost())
7677
{
7778
StartHostFailed();
78-
}
79+
}
7980
}
8081
}
8182
catch (Exception)

Assets/Scripts/Gameplay/GameState/ClientCharSelectState.cs

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,23 @@
1212
namespace Unity.BossRoom.Gameplay.GameState
1313
{
1414
/// <summary>
15-
/// Client specialization of the Character Select game state. Mainly controls the UI during character-select.
15+
/// Client specialization of the Character Select game state. Mainly controls the UI during character-select.
1616
/// </summary>
1717
[RequireComponent(typeof(NetcodeHooks))]
1818
public class ClientCharSelectState : GameStateBehaviour
1919
{
2020
/// <summary>
21-
/// Reference to the scene's state object so that UI can access state
21+
/// Reference to the scene's state object so that UI can access state
2222
/// </summary>
2323
public static ClientCharSelectState Instance { get; private set; }
2424

2525
[SerializeField]
2626
NetcodeHooks m_NetcodeHooks;
2727

28-
public override GameState ActiveState { get { return GameState.CharSelect; } }
28+
public override GameState ActiveState
29+
{
30+
get { return GameState.CharSelect; }
31+
}
2932

3033
[SerializeField]
3134
NetworkCharSelection m_NetworkCharSelection;
@@ -49,6 +52,7 @@ public class ColorAndIndicator
4952
public Sprite Indicator;
5053
public Color Color;
5154
}
55+
5256
[Tooltip("Representational information for each player")]
5357
public ColorAndIndicator[] m_IdentifiersForEachPlayerNumber;
5458

@@ -68,7 +72,7 @@ public class ColorAndIndicator
6872
[SerializeField]
6973
[Tooltip("UI elements to turn on when the player has locked in their seat choice (and is now waiting for other players to do the same). Turned off otherwise!")]
7074
List<GameObject> m_UIElementsForSeatChosen;
71-
75+
7276
[SerializeField]
7377
[Tooltip("UI elements to turn on when the session is closed (and game is about to start). Turned off otherwise!")]
7478
List<GameObject> m_UIElementsForSessionEnding;
@@ -95,10 +99,10 @@ public class ColorAndIndicator
9599
Dictionary<Guid, GameObject> m_SpawnedCharacterGraphics = new Dictionary<Guid, GameObject>();
96100

97101
/// <summary>
98-
/// Conceptual modes or stages that the session can be in. We don't actually
99-
/// bother to keep track of what SessionMode we're in at any given time; it's just
100-
/// an abstraction that makes it easier to configure which UI elements should
101-
/// be enabled/disabled in each stage of the session.
102+
/// Conceptual modes or stages that the session can be in. We don't actually
103+
/// bother to keep track of what SessionMode we're in at any given time; it's just
104+
/// an abstraction that makes it easier to configure which UI elements should
105+
/// be enabled/disabled in each stage of the session.
102106
/// </summary>
103107
enum SessionMode
104108
{
@@ -175,7 +179,7 @@ void OnNetworkSpawn()
175179
}
176180

177181
/// <summary>
178-
/// Called when our PlayerNumber (e.g. P1, P2, etc.) has been assigned by the server
182+
/// Called when our PlayerNumber (e.g. P1, P2, etc.) has been assigned by the server
179183
/// </summary>
180184
/// <param name="playerNum"></param>
181185
void OnAssignedPlayerNumber(int playerNum)
@@ -191,7 +195,7 @@ void UpdatePlayerCount()
191195
}
192196

193197
/// <summary>
194-
/// Called by the server when any of the seats in the session have changed. (Including ours!)
198+
/// Called by the server when any of the seats in the session have changed. (Including ours!)
195199
/// </summary>
196200
void OnSessionPlayerStateChanged(NetworkListEvent<NetworkCharSelection.SessionPlayerState> changeEvent)
197201
{
@@ -219,6 +223,7 @@ void OnSessionPlayerStateChanged(NetworkListEvent<NetworkCharSelection.SessionPl
219223
{
220224
// we haven't chosen a seat yet (or were kicked out of our seat by someone else)
221225
UpdateCharacterSelection(NetworkCharSelection.SeatState.Inactive);
226+
222227
// make sure our player num is properly set in Session UI
223228
OnAssignedPlayerNumber(m_NetworkCharSelection.sessionPlayers[localPlayerIdx].PlayerNumber);
224229
}
@@ -230,9 +235,9 @@ void OnSessionPlayerStateChanged(NetworkListEvent<NetworkCharSelection.SessionPl
230235
}
231236

232237
/// <summary>
233-
/// Internal utility that sets the character-graphics and class-info box based on
234-
/// our chosen seat. It also triggers a SessionMode change when it notices that our seat-state
235-
/// is LockedIn.
238+
/// Internal utility that sets the character-graphics and class-info box based on
239+
/// our chosen seat. It also triggers a SessionMode change when it notices that our seat-state
240+
/// is LockedIn.
236241
/// </summary>
237242
/// <param name="state">Our current seat state</param>
238243
/// <param name="seatIdx">Which seat we're sitting in, or -1 if SeatState is Inactive</param>
@@ -271,6 +276,7 @@ void UpdateCharacterSelection(NetworkCharSelection.SeatState state, int seatIdx
271276
m_ClassInfoBox.ConfigureForClass(m_NetworkCharSelection.AvatarConfiguration[seatIdx].CharacterClass);
272277
}
273278
}
279+
274280
if (state == NetworkCharSelection.SeatState.LockedIn && !m_HasLocalPlayerLockedIn)
275281
{
276282
// the local player has locked in their seat choice! Rearrange the UI appropriately
@@ -297,7 +303,7 @@ void UpdateCharacterSelection(NetworkCharSelection.SeatState state, int seatIdx
297303
}
298304

299305
/// <summary>
300-
/// Internal utility that sets the graphics for the eight session-seats (based on their current networked state)
306+
/// Internal utility that sets the graphics for the eight session-seats (based on their current networked state)
301307
/// </summary>
302308
void UpdateSeats()
303309
{
@@ -326,7 +332,7 @@ void UpdateSeats()
326332
}
327333

328334
/// <summary>
329-
/// Called by the server when the session closes (because all players are seated and locked in)
335+
/// Called by the server when the session closes (because all players are seated and locked in)
330336
/// </summary>
331337
void OnSessionClosedChanged(bool wasSessionClosed, bool isSessionClosed)
332338
{
@@ -349,9 +355,9 @@ void OnSessionClosedChanged(bool wasSessionClosed, bool isSessionClosed)
349355
}
350356

351357
/// <summary>
352-
/// Turns on the UI elements for a specified "session mode", and turns off UI elements for all other modes.
353-
/// It can also disable/enable the session seats and the "Ready" button if they are inappropriate for the
354-
/// given mode.
358+
/// Turns on the UI elements for a specified "session mode", and turns off UI elements for all other modes.
359+
/// It can also disable/enable the session seats and the "Ready" button if they are inappropriate for the
360+
/// given mode.
355361
/// </summary>
356362
void ConfigureUIForSessionMode(SessionMode mode)
357363
{
@@ -380,8 +386,10 @@ void ConfigureUIForSessionMode(SessionMode mode)
380386
{
381387
m_CurrentCharacterGraphics.gameObject.SetActive(false);
382388
}
389+
383390
m_ClassInfoBox.ConfigureForNoSelection();
384391
}
392+
385393
m_ReadyButtonText.text = "READY!";
386394
break;
387395
case SessionMode.SeatChosen:
@@ -405,11 +413,10 @@ void ConfigureUIForSessionMode(SessionMode mode)
405413
// disable interaction if seat is already locked or all seats disabled
406414
seat.SetDisableInteraction(seat.IsLocked() || isSeatsDisabledInThisMode);
407415
}
408-
409416
}
410417

411418
/// <summary>
412-
/// Called directly by UI elements!
419+
/// Called directly by UI elements!
413420
/// </summary>
414421
/// <param name="seatIdx"></param>
415422
public void OnPlayerClickedSeat(int seatIdx)
@@ -421,7 +428,7 @@ public void OnPlayerClickedSeat(int seatIdx)
421428
}
422429

423430
/// <summary>
424-
/// Called directly by UI elements!
431+
/// Called directly by UI elements!
425432
/// </summary>
426433
public void OnPlayerClickedReady()
427434
{
@@ -442,6 +449,5 @@ GameObject GetCharacterGraphics(Avatar avatar)
442449

443450
return characterGraphics;
444451
}
445-
446452
}
447453
}

Assets/Scripts/Gameplay/UI/Session/SessionListItemUI.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,20 @@
77
namespace Unity.BossRoom.Gameplay.UI
88
{
99
/// <summary>
10-
/// An individual Session UI in the list of available Sessions.
10+
/// An individual Session UI in the list of available Sessions.
1111
/// </summary>
1212
public class SessionListItemUI : MonoBehaviour
1313
{
14-
[SerializeField] TextMeshProUGUI m_SessionNameText;
15-
[SerializeField] TextMeshProUGUI m_SessionCountText;
14+
[SerializeField]
15+
TextMeshProUGUI m_SessionNameText;
16+
[SerializeField]
17+
TextMeshProUGUI m_SessionCountText;
1618

17-
[Inject] SessionUIMediator m_SessionUIMediator;
19+
[Inject]
20+
SessionUIMediator m_SessionUIMediator;
1821

1922
ISessionInfo m_Data;
20-
23+
2124
public void SetData(ISessionInfo data)
2225
{
2326
m_Data = data;

0 commit comments

Comments
 (0)