From 0bba89a7858ce091f485e04284f853e1f7f304af Mon Sep 17 00:00:00 2001 From: Leonardo Bishop Date: Sun, 6 Aug 2023 17:21:45 +0100 Subject: Reformat --- code/Game.cs | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) (limited to 'code/Game.cs') diff --git a/code/Game.cs b/code/Game.cs index 356cd38..8903155 100644 --- a/code/Game.cs +++ b/code/Game.cs @@ -1,13 +1,11 @@ - +using System; +using System.Linq; using Sandbox; using Sandbox.UI; -using System; -using System.Collections.Generic; -using System.Linq; namespace MurderGame; -public partial class MurderGame : Sandbox.GameManager +public partial class MurderGame : GameManager { public MurderGame() { @@ -17,10 +15,7 @@ public partial class MurderGame : Sandbox.GameManager } } - public static MurderGame Instance - { - get => Current as MurderGame; - } + public static MurderGame Instance => Current as MurderGame; [ConVar.Server( "mu_min_players", Help = "The minimum number of players required to start a round." )] @@ -31,23 +26,23 @@ public partial class MurderGame : Sandbox.GameManager [ConVar.Server( "mu_round_time", Help = "The amount of time, in seconds, in a round." )] public static int RoundTime { get; set; } = 600; - - [ConVar.Client( "mu_max_footprint_time", Help = "The amount of time, in seconds, footprints are visible for. Max 30 seconds." )] + + [ConVar.Client( "mu_max_footprint_time", + Help = "The amount of time, in seconds, footprints are visible for. Max 30 seconds." )] public static int MaxFootprintTime { get; set; } = 30; - [Net] - public BasePhase CurrentPhase { get; set; } = new WaitPhase() { CountIn = true }; + [Net] public BasePhase CurrentPhase { get; set; } = new WaitPhase { CountIn = true }; [GameEvent.Tick.Server] public void TickServer() { CurrentPhase.Tick(); - - if (CurrentPhase.NextPhase != null && CurrentPhase.IsFinished) + + if ( CurrentPhase.NextPhase != null && CurrentPhase.IsFinished ) { CurrentPhase.Deactivate(); CurrentPhase = CurrentPhase.NextPhase; - Log.Info("Advancing phase to " + CurrentPhase.ToString()); + Log.Info( "Advancing phase to " + CurrentPhase ); CurrentPhase.Activate(); } } @@ -61,7 +56,7 @@ public partial class MurderGame : Sandbox.GameManager client.Pawn = pawn; pawn.Spawn(); - var spawnpoints = Entity.All.OfType(); + var spawnpoints = All.OfType(); var randomSpawnPoint = spawnpoints.OrderBy( x => Guid.NewGuid() ).FirstOrDefault(); if ( randomSpawnPoint != null ) { @@ -75,9 +70,8 @@ public partial class MurderGame : Sandbox.GameManager public override void ClientDisconnect( IClient client, NetworkDisconnectionReason reason ) { - base.ClientDisconnect(client, reason ); + base.ClientDisconnect( client, reason ); - ChatBox.Say( client.Name + " left the game (" + reason.ToString() + ")" ); + ChatBox.Say( client.Name + " left the game (" + reason + ")" ); } } - -- cgit v1.2.3-70-g09d2