Esempio n. 1
0
    /// <summary>
    /// 
    /// </summary>
    private void _run()
    {
      //initialize the game params first
      GameParameters.Initialize((int)_viewFramework.GetScreenDimension().X, (int)_viewFramework.GetScreenDimension().Y);
      
      GameLogger.Initialize(Console.Out);
      EventBus eventBus = new EventBus();
      EventFactory eventFactory = new EventFactory();
      EventMonitor eventMonitor = new EventMonitor(eventFactory,eventBus);
      //this thread will be blocked at GetIGameSpriteFactory() until ContentManager is initialized
      GameObjectFactory gameObjectFactory = new GameObjectFactory(eventMonitor, _viewFramework.GetIGameSpriteFactory());
      GameObjectContainer gameObjects = new GameObjectContainer();
      MainEventProcessor mainEventListener = new MainEventProcessor(gameObjects, gameObjectFactory, eventBus);
      GameModel gameModel = new GameModel(gameObjects, gameObjectFactory);
      GameController gameController = new GameController(eventBus, gameModel, eventFactory, _viewFramework);

      //controller runs forever-loop
      gameController.Run();
    }
Esempio n. 2
0
 public GameModel(GameObjectContainer objects, GameObjectFactory objectFactory)
 {
   _minSeparation = GameParameters.MIN_SEPARATION_HEURISTIC_VALUE;
   _gameObjectFactory = objectFactory;
   _gameObjectCollection = objects;
 }