refactor: added server project
This commit is contained in:
@@ -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();
|
||||
|
Reference in New Issue
Block a user