public static void Render(GameEngine engine, GraphicsRenderer renderer, ClientGameSession session, GameTime gameTime)
        {
            ClientGameEnvironment environment = session.Environment;

            if (environment != null)
            {
                EnvironmentRenderer.Render(engine, renderer, environment, gameTime);
            }
        }
        public static void Update(GameEngine engine, ClientGameSession session, GameTime gameTime)
        {
            ClientGameEnvironment environment = session.Environment;

            if (environment != null)
            {
                EnvironmentRenderer.Update(engine, environment, gameTime);
            }
        }
        // GET: Client
        public ActionResult Index(string id)
        {
            ServerGameSession game = MvcApplication.Manager.FindSessionByClientId(id);

            if (game != null)
            {
                ClientGameSession session = new ClientGameSession();
                session.ClientId = id;
                session.GameId   = game.GameId;
                session.GameName = game.GameName;
                return(View(session));
            }
            else
            {
                return(View("Error"));
            }
        }
        public override void Initialise(GameEngine engine)
        {
            base.Initialise(engine);

            _players = new[] {
                new ClientPlayer("Player 1", Color.Red),
                new ClientPlayer("Player 2", Color.Blue)
            };
            _gameEnvironment = new ClientGameEnvironment();
            _gameSession     = new ClientGameSession(_gameEnvironment, _players);

            // TODO: Testing only
            _gameEnvironment.Map = new ClientMap(9, 9);
            CorePlayerUnit unit = PlayerUnitFactory.CreateNew(_players[0], PlayerUnitType.TestSoldier);

            _gameEnvironment.Map.Entities.Add(new ClientPlayerUnit(unit));

            CorePlayerUnit unit6 = PlayerUnitFactory.CreateNew(_players[0], PlayerUnitType.TestSoldier);

            unit6.SetPosition(3, 3);
            _gameEnvironment.Map.Entities.Add(new ClientPlayerUnit(unit6));

            CorePlayerUnit unit2 = PlayerUnitFactory.CreateNew(_players[1], PlayerUnitType.TestSniper);

            unit2.SetPosition(2, 2);
            _gameEnvironment.Map.Entities.Add(new ClientPlayerUnit(unit2));

            CorePlayerUnit unit3 = PlayerUnitFactory.CreateNew(_players[0], PlayerUnitType.TestAssault);

            unit3.SetPosition(1, 5);
            _gameEnvironment.Map.Entities.Add(new ClientPlayerUnit(unit3));

            CorePlayerUnit unit4 = PlayerUnitFactory.CreateNew(_players[1], PlayerUnitType.TestMech);

            unit4.SetPosition(0, 6);
            _gameEnvironment.Map.Entities.Add(new ClientPlayerUnit(unit4));
        }