refactor: added server project

This commit is contained in:
2025-06-06 23:54:03 +03:00
parent b835fb1582
commit 2294c06bf9
9 changed files with 142 additions and 66 deletions

View File

@@ -1,16 +1,22 @@
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Linq;
using Microsoft.Xna.Framework.Graphics;
using Syntriax.Engine.Core;
using Syntriax.Engine.Integration.MonoGame;
using var game = new Pong.GamePong();
bool isServerEnabled = Environment.GetCommandLineArgs().FirstOrDefault(x => x.CompareTo("--server") == 0) is not null;
game.Universe
.InstantiateUniverseObject().SetUniverseObject("Desktop HO")
IUniverse universe = Pong.PongUniverse.GetPongUniverse(isServerEnabled, isClientEnabled: true);
universe.InstantiateUniverseObject().SetUniverseObject("Desktop HO")
.BehaviourController.AddBehaviour<KeyboardInputsBehaviour>();
game.Graphics.PreferredBackBufferWidth = 1024;
game.Graphics.PreferredBackBufferHeight = 576;
game.Graphics.GraphicsProfile = GraphicsProfile.HiDef;
using MonoGameWindow monoGameWindow = new(universe);
game.Run();
monoGameWindow.Graphics.PreferredBackBufferWidth = 1024;
monoGameWindow.Graphics.PreferredBackBufferHeight = 576;
monoGameWindow.Graphics.GraphicsProfile = GraphicsProfile.HiDef;
monoGameWindow.Run();