Пример #1
0
 public PhysicsEngine(IMessageBus bus, IObservableTimer timer,IGameObjectFactory gameObjectFactory)
 {
     Timer = timer;
     Bus = bus;
     Running = false;
     _gameObjectFactory = gameObjectFactory;
 }
Пример #2
0
 protected AwesomiumGUI(IAssets assets,IMessageBus bus,IObservableTimer timer )
 {
     Assets = assets;
     Bus = bus;
     Timer = timer;
     WebCore.Initialize(new WebCoreConfig { CustomCSS = "::-webkit-scrollbar { visibility: hidden; }" });
 }
Пример #3
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;
 }
Пример #4
0
 public TwitterBotCommand(
     ILogger <TwitterBotCommand> log,
     TwitterBotConfig botConfig,
     IObservableTimer timerCreator,
     IMarketMonitor marketMonitor,
     ISentimentMonitor sentimentMonitor,
     IChartMonitor chartMonitor)
     : base(log)
 {
     this.log              = log ?? throw new ArgumentNullException(nameof(log));
     this.botConfig        = botConfig ?? throw new ArgumentNullException(nameof(botConfig));
     this.timerCreator     = timerCreator ?? throw new ArgumentNullException(nameof(timerCreator));
     this.marketMonitor    = marketMonitor ?? throw new ArgumentNullException(nameof(marketMonitor));
     this.sentimentMonitor = sentimentMonitor ?? throw new ArgumentNullException(nameof(sentimentMonitor));
     this.chartMonitor     = chartMonitor ?? throw new ArgumentNullException(nameof(chartMonitor));
 }
Пример #5
0
        public GraphicsWindow(IMessageBus bus, IObservableTimer timer)
            : base(1280, 720, new GraphicsMode(32, 0, 0, 4), "Sharp Engine")
        {
            Views = new ConcurrentDictionary<int, IGameObjectView>();
            _assets = new AssetManager
                          {
                              Shaders = new ShaderProvider(),
                              VBO = new VBOProvider(),
                              Textures = new TextureProvider()
                          };
            _timer = timer;
            Bus = bus;

            _gui = new GUIManager(_assets);

            Mouse.ButtonDown += MouseButtonDown;

            Bus.OfType<GameObjectCreated>().Subscribe(OnGameObjectCreated);
        }
Пример #6
0
        public GraphicsWindow(IMessageBus bus, IObservableTimer timer, IGUI gui, IAssets assets, IProfiler profiler, ICamera camera)
            : base(1280, 720, new GraphicsMode(32, 0, 0, 4), "Sharp Engine")
        {
            _profiler = profiler;
            _camera = camera;
            _profile = _profiler.Profile("Graphics");
            _timer = timer;
            _gui = gui;
            Bus = bus;

            Views = new ConcurrentDictionary<Guid, IGameObjectView>();
            SetupGUI();

            _assets = assets;
            foreach (var viewtype in AppDomain.CurrentDomain.GetAssemblies().ToList().SelectMany(s => s.GetTypes()).Where(p => typeof(IGameObjectView).IsAssignableFrom(p) && p.IsClass && p.IsDefined(typeof(BindViewAttribute), false)).ToList())
            {
                var bindViewAttribute = viewtype.GetCustomAttributes(typeof(BindViewAttribute), true).Cast<BindViewAttribute>().FirstOrDefault();
                if (bindViewAttribute != null) _availableViews.Add(bindViewAttribute.GameObjectType, viewtype);
            }

            Bus.OfType<GameObjectCreated>().Subscribe(OnGameObjectCreated);
        }
Пример #7
0
        public LightAutomationService(IEventAggregator eventAggregator,
                                      IDaylightService daylightService,
                                      ILogService logService,
                                      IConcurrencyProvider concurrencyProvider,
                                      IMotionConfigurationProvider motionConfigurationProvider,
                                      IObservableTimer observableTimer
                                      )
        {
            if (logService == null)
            {
                throw new ArgumentNullException(nameof(logService));
            }
            _logger              = logService.CreatePublisher(nameof(LightAutomationService));
            _eventAggregator     = eventAggregator ?? throw new ArgumentNullException(nameof(eventAggregator));
            _daylightService     = daylightService ?? throw new ArgumentNullException(nameof(daylightService));
            _concurrencyProvider = concurrencyProvider ?? throw new ArgumentNullException(nameof(concurrencyProvider));

            var configurationProvider = motionConfigurationProvider ?? throw new ArgumentNullException(nameof(motionConfigurationProvider));

            _motionConfiguration = configurationProvider.GetConfiguration();
            _observableTimer     = observableTimer;
        }
Пример #8
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)
        {
        }
Пример #9
0
 public GraphicsEngine(IMessageBus bus, IObservableTimer timer)
 {
     Timer = timer;
     Bus = bus;
 }
Пример #10
0
 protected LightAutomationService(IConcurrencyProvider concurrencyProvider, IObservableTimer observableTimer)
 {
     _concurrencyProvider = concurrencyProvider;
     _observableTimer     = observableTimer;
 }
Пример #11
0
 public TestPhysics(IMessageBus bus, IObservableTimer timer, IGameObjectFactory gameObjectFactory)
     : base(bus, timer, gameObjectFactory)
 {
 }
Пример #12
0
 public TestAudio(IMessageBus bus, IObservableTimer timer)
     : base(bus, timer)
 {
     Bus.OfType<ObjectsCollided>().Subscribe(PlaySound);
 }