当前位置: 首页>>代码示例>>C#>>正文


C# IMessageBus.OfType方法代码示例

本文整理汇总了C#中IMessageBus.OfType方法的典型用法代码示例。如果您正苦于以下问题:C# IMessageBus.OfType方法的具体用法?C# IMessageBus.OfType怎么用?C# IMessageBus.OfType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IMessageBus的用法示例。


在下文中一共展示了IMessageBus.OfType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GameObjectFactory

 public GameObjectFactory(IMessageBus bus,IObjectCreator creator)
 {
     _creator = creator;
     GameObjects = new ConcurrentDictionary<Guid, IGameObject>();
     Bus = bus;
     Bus.OfType<GameObjectRequest>().Subscribe(CreateGameObject);
        // Bus.OfType<DestroyGameObject>().Subscribe(DestroyGameObject);
 }
开发者ID:veggielane,项目名称:BlockRTS,代码行数:8,代码来源:GameObjectFactory.cs

示例2: Game

        public Game(ITimer timer, IGraphics graphics, IMessageBus bus, IGameObjectFactory factory)
        {
            Timer = timer;
            Timer.SubSample(5).Subscribe(t => Bus.SendAll());
            Graphics = graphics;
            Bus = bus;
            Factory = factory;
            Timer.Subscribe(Update);

            Bus.OfType<RequestCloseMessage>().Subscribe(m => Stop());
        }
开发者ID:veggielane,项目名称:BlockRTS,代码行数:11,代码来源:Game.cs

示例3: GameEngine

 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;
 }
开发者ID:veggielane,项目名称:SharpEngine,代码行数:15,代码来源:GameEngine.cs

示例4: GraphicsWindow

        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);
        }
开发者ID:veggielane,项目名称:SharpEngine,代码行数:19,代码来源:GraphicsWindow.cs


注:本文中的IMessageBus.OfType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。