Ejemplo n.º 1
0
 public frmMaler()
 {
     InitializeComponent();
     engine = GraphicsEngine.GetInstance();
     engine.WorkingBitmapChanged += WorkingBitmapChanged_Event;
     engine.StableBitmapChanged  += StableBitmapChanged_Event;
 }
Ejemplo n.º 2
0
 static public void RegisterGraphcisEngine(this IGraphicsEngine engine)
 {
     if (engine != null &&
         _registeredGraphicsEngines.Where(e => e.EngineName == engine.EngineName).Count() == 0)
     {
         _registeredGraphicsEngines.Add(engine);
     }
 }
Ejemplo n.º 3
0
 protected BaseGameEngine(IMessageBus bus, IGraphicsEngine graphics, ILevel level, ITimer timer, IGameObjectFactory gameObjectFactory)
 {
     _graphics = graphics;
     _timer = timer;
     _gameObjectFactory = gameObjectFactory;
     Bus = bus;
     Level = level;
     _timer.Ticks.Subscribe(Update);
 }
Ejemplo n.º 4
0
 public GameEngine(IObservableTimer timer, IMessageBus bus, IGameObjectFactory factory, IGraphicsEngine graphics,
                   IAudioEngine audio, IPhysicsEngine physics)
 {
     Timer = timer;
     Bus = bus;
     Graphics = graphics;
     Audio = audio;
     Physics = physics;
     Factory = factory;
     Bus.Add(new DebugMessage(Timer.LastTickTime, "Initialising Engines"));
     Bus.OfType<ExitGameRequest>().Subscribe(m => Stop());
     Timer.Subscribe(Update);
     Timer.SubSample(5).Subscribe(t => bus.SendAll());
     Running = false;
 }
Ejemplo n.º 5
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            //// Create a new SpriteBatch, which can be used to draw textures.
            this.spriteBatch = new SpriteBatch(this.GraphicsDevice);
            ////
            this.graphicsEngine = new GraphicsEngine(this.spriteBatch);
            this.controller     = new ControllerUserInput();
            ITextureHandler textureHandler = new TextureHandler(this.Content);
            IPaintInterface painter        = new PaintBrush(textureHandler, this.graphicsEngine);

            this.engine = new Engine(this.controller, painter);
            ////
            this.gameLoader     = new GameLoader(new UnitOfWork(), this.engine);
            this.consoleHandler = new ConsoleHandler(this.console, this.gameLoader);
        }
Ejemplo n.º 6
0
        //---------------------------------------------------------------
        #endregion
        //---------------------------------------------------------------

        //---------------------------------------------------------------
        #region Initialisation
        //---------------------------------------------------------------
        private GraphicsEngine(IGraphicsEngine engine)
        {
            this.engine = engine;
            this.device = Devices[0];
        }
Ejemplo n.º 7
0
        /*
        public TestGameEngine()
            : base(new AsyncObservableTimer(), new MessageBus(), new TestFactory(), new TestGraphics(), new TestAudio(), new TestPhysics())
        {
            Bus.OfType<GraphicsReady>().Subscribe(Start);
        }

        private void Start(GraphicsReady m)
        {
            Bus.Add(new DebugMessage(Timer.LastTickTime, "Starting Game"));

            for (int y = 0; y < 2; y++)
            for (int x = 0; x < 3; x++)
            {
                Bus.Add(new GameObjectRequest(m.TimeSent, new TestGameObject(Bus), new Vect3(3 * x, 3 * y , 0)));
            }

            var testGameObject = new TestGameObject(Bus);
            Bus.Add(new GameObjectRequest(m.TimeSent, testGameObject, new Vect3(-11, -1, 0)));
            Bus.Add(new SetVelocity(Timer.LastTickTime, testGameObject, new Vect3(3, 0, 0)));
        }
         * */
        public TestGameEngine(IObservableTimer timer, IMessageBus bus, IGameObjectFactory factory, IGraphicsEngine graphics, IAudioEngine audio, IPhysicsEngine physics)
            : base(timer, bus, factory, graphics, audio, physics)
        {
        }
Ejemplo n.º 8
0
 public PaintBrush(ITextureHandler textureHandler, IGraphicsEngine graphicsEngine)
 {
     this.textureHandler = textureHandler;
     this.graphicsEngine = graphicsEngine;
 }
Ejemplo n.º 9
0
 public TestGameEngine(IMessageBus bus, IGraphicsEngine graphics, ILevel level, ITimer timer, IGameObjectFactory gameObjectFactory)
     : base(bus, graphics, level, timer, gameObjectFactory)
 {
 }