Пример #1
0
        public MessagingTracker(ISubscribableRouter router)
        {
            _router       = router;
            _tracker      = new List <T>();
            _newInstances = new List <T>();
            NewInstances  = new ReadOnlyCollection <T>(_newInstances);

            _router.Add <ICompositionMessage <T> >(Interpret);
            _router.Add <IDecompositionMessage <T> >(Interpret);
        }
Пример #2
0
        public MessagingSpace(ISubscribableRouter router, Func <T, Vector2> getPoint, Func <T, TopLeftRectangle> getBox, IPartitioner partitioner = null)
        {
            _router       = router;
            _space        = new Space <T>(getPoint, getBox, partitioner);
            _newInstances = new List <T>();
            NewInstances  = new ReadOnlyCollection <T>(_newInstances);

            _router.Add <ICompositionMessage <T> >(Interpret);
            _router.Add <IDecompositionMessage <T> >(Interpret);
        }
Пример #3
0
        public ProjectionManager(RootView rootView, ISubscribableRouter subscribableRouter)
        {
            _rootView = rootView;
            _views    = new MessagingTracker <IView>(subscribableRouter);

            _sceneRoots = new ObservableList <ISceneNodeComponent>();
            SceneRoots  = new ReadOnlyObservableList <ISceneNodeComponent>(_sceneRoots);

            subscribableRouter.Add <ICompositionMessage <ISceneNodeComponent> >(Interpret);
            subscribableRouter.Add <IDecompositionMessage <ISceneNodeComponent> >(Interpret);
        }