Example #1
0
        public override void OnInitialise()
        {
            GameSimRules rules = new GameSimRules();

            rules.FragWinLimit  = 20;
            rules.RespawnTime   = 5;
            rules.GameTimeLimit = 300;

            var gameSim = new GameSimulation(rules);

            SystemCore.AddNewUpdateRenderSubsystem(gameSim);
            SystemCore.CursorVisible = true;
            SystemCore.ActiveScene.SetUpAmbientAndFullLightingRig();

            cameraObject = new GameObject();
            cameraObject.AddComponent(new ComponentCamera(MathHelper.PiOver4, SystemCore.GraphicsDevice.Viewport.AspectRatio, 1f, 200f, false));
            SystemCore.GameObjectManager.AddAndInitialiseGameObject(cameraObject);
            SystemCore.SetActiveCamera(cameraObject.GetComponent <ComponentCamera>());
            cameraObject.Transform.AbsoluteTransform = Matrix.CreateWorld(new Vector3(0, 200, 0), new Vector3(0, -1, 0), new Vector3(0, 0, 1));



            host = WebHostHelper.CreateWebHost(gameSim);


            base.OnInitialise();
        }
        /// <summary>
        /// When overridden in a derived class, executes the task.
        /// </summary>
        /// <returns>
        /// true if the task successfully executed; otherwise, false.
        /// </returns>
        public override bool Execute()
        {
            try
            {
                ProcessHelper.KillAll(WebHostHelper.WebHostProcessName);
            }
            catch (Exception ex)
            {
                Log.LogMessage("Was not possible kill all web dev server instances: {0}", ex.Message);
            }

            WebHostHelper.StartAndWaitForResponse(ProjectFolderName, Port);

            return(true);
        }
Example #3
0
 /// <summary>
 ///     Builds the web host.
 /// </summary>
 /// <param name="args">The arguments.</param>
 /// <returns></returns>
 public static IWebHost BuildWebHost(string[] args)
 {
     return(WebHostHelper.InitializeApplication(args));
 }
Example #4
0
 public static void Main(string[] args)
 {
     WebHostHelper.BuildAndRunWebApp <Program>(args);
 }
Example #5
0
 public static void Main(string[] args)
 {
     WebHostHelper.BuildAndRunWebAPI <Program, TextProcessDependenciesConfiguration>(args);
 }