From 5afb8b69bf657ce1fa15692da329e8a4eae718e7 Mon Sep 17 00:00:00 2001 From: Syntriax Date: Sun, 4 Feb 2024 12:23:41 +0300 Subject: [PATCH] refactor: Window Title According to Network State --- Game/GamePong.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Game/GamePong.cs b/Game/GamePong.cs index bf39109..126a263 100644 --- a/Game/GamePong.cs +++ b/Game/GamePong.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -139,13 +139,21 @@ public class GamePong : Game if (commandLineArguments.Length != 1) { if (commandLineArguments[1].Equals("server", StringComparison.OrdinalIgnoreCase)) + { pongManager.BehaviourController.AddBehaviour().Start(8888, 2); + Window.Title = "Pong - Server"; + } else + { + Window.Title = $"Pong - Client -> {commandLineArguments[1]}"; pongManager.BehaviourController.AddBehaviour().Connect(commandLineArguments[1], 8888); - + } } else + { pongManager.BehaviourController.AddBehaviour().Connect("127.0.0.1", 8888); + Window.Title = $"Pong - Client -> 127.0.0.1"; + } } protected override void Update(GameTime gameTime)