Ejemplo n.º 1
0
        public GameController()
        {
            var    assemblies  = new List <Assembly>();
            string assemblyDir = Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath);

            assemblies.Add(Assembly.LoadFrom(Path.Combine(assemblyDir, "SS14.Client.Services.dll")));

            IoCManager.AddAssemblies(assemblies);

            _configurationManager = IoCManager.Resolve <IPlayerConfigurationManager>();
            _configurationManager.Initialize("./player_config.xml");

            _resourceManager = IoCManager.Resolve <IResourceManager>();

            _resourceManager.LoadBaseResources();
            _resourceManager.LoadLocalResources();

            //Setup Cluwne first, as the rest depends on it.
            SetupCluwne();

            //Initialization of private members
            _networkManager       = IoCManager.Resolve <INetworkManager>();
            _netGrapher           = IoCManager.Resolve <INetworkGrapher>();
            _stateManager         = IoCManager.Resolve <IStateManager>();
            _userInterfaceManager = IoCManager.Resolve <IUserInterfaceManager>();

            _stateManager.RequestStateChange <MainScreen> ();

            FrameEventArgs _frameEvent;
            EventArgs      _frameEventArgs;

            _clock = new SFML.System.Clock();

            while (CluwneLib.IsRunning == true)
            {
                var lastFrameTime = _clock.ElapsedTime.AsSeconds();
                _clock.Restart();
                _frameEvent = new FrameEventArgs(lastFrameTime);
                CluwneLib.ClearCurrentRendertarget(Color.Black);
                CluwneLib.Screen.DispatchEvents();
                CluwneLib.RunIdle(this, _frameEvent);
                CluwneLib.Screen.Display();
            }
            CluwneLib.Terminate();
            Console.WriteLine("Gameloop terminated.");
        }
Ejemplo n.º 2
0
        public GameController()
        {
            _configurationManager = IoCManager.Resolve <IPlayerConfigurationManager>();
            _configurationManager.Initialize("./player_config.xml");

            _resourceManager = IoCManager.Resolve <IResourceManager>();

            _resourceManager.LoadBaseResources();
            _resourceManager.LoadLocalResources();

            //Setup Cluwne first, as the rest depends on it.
            SetupCluwne();

            //Initialization of private members
            _networkManager       = IoCManager.Resolve <INetworkManager>();
            _netGrapher           = IoCManager.Resolve <INetworkGrapher>();
            _stateManager         = IoCManager.Resolve <IStateManager>();
            _userInterfaceManager = IoCManager.Resolve <IUserInterfaceManager>();



            _stateManager.RequestStateChange <MainScreen> ();

            FrameEventArgs _frameEvent;
            EventArgs      _frameEventArgs;

            _clock = new SFML.System.Clock();


            while (CluwneLib.IsRunning == true)
            {
                var lastFrameTime = _clock.ElapsedTime.AsSeconds();
                _clock.Restart();
                _frameEvent = new FrameEventArgs(lastFrameTime);
                CluwneLib.ClearCurrentRendertarget(Color.Black);
                CluwneLib.Screen.DispatchEvents();
                CluwneLib.RunIdle(this, _frameEvent);
                CluwneLib.Screen.Display();
            }
            CluwneLib.Terminate();
            Console.WriteLine("Gameloop terminated.");
        }
Ejemplo n.º 3
0
        public GameController()
        {
            _configurationManager = IoCManager.Resolve<IPlayerConfigurationManager>();
            _configurationManager.Initialize("./player_config.xml");

            _resourceManager = IoCManager.Resolve<IResourceManager>();

            _resourceManager.LoadBaseResources();
            _resourceManager.LoadLocalResources();

            //Setup Cluwne first, as the rest depends on it.
            SetupCluwne ();

            //Initialization of private members
            _networkManager = IoCManager.Resolve<INetworkManager>();
            _netGrapher = IoCManager.Resolve<INetworkGrapher>();
            _stateManager = IoCManager.Resolve<IStateManager>();
            _userInterfaceManager = IoCManager.Resolve<IUserInterfaceManager>();

            SetupInput ();

            _stateManager.RequestStateChange<TestState> ();

            FrameEventArgs _frameEvent;
            EventArgs _frameEventArgs;
            _clock = new SFML.System.Clock();

            while (CluwneLib.IsRunning == true)
            {
                var lastFrameTime = _clock.ElapsedTime.AsSeconds();
                _clock.Restart();
                _frameEvent = new FrameEventArgs(lastFrameTime);
                CluwneLib.ClearCurrentRendertarget (Color.Black);
                CluwneLib.Screen.DispatchEvents();
                CluwneLib.RunIdle (this, _frameEvent);
                CluwneLib.Screen.Display();
            }
            CluwneLib.Terminate();
            Console.WriteLine("Gameloop terminated.");
        }