コード例 #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
ファイル: GameEngine.cs プロジェクト: veggielane/SharpEngine
 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
ファイル: Program.cs プロジェクト: veggielane/SharpEngine
 public TestPhysics(IMessageBus bus, IObservableTimer timer, IGameObjectFactory gameObjectFactory)
     : base(bus, timer, gameObjectFactory)
 {
 }
コード例 #12
0
ファイル: Program.cs プロジェクト: veggielane/SharpEngine
 public TestAudio(IMessageBus bus, IObservableTimer timer)
     : base(bus, timer)
 {
     Bus.OfType<ObjectsCollided>().Subscribe(PlaySound);
 }