示例#1
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);
        }
示例#2
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);
        }
示例#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);
        }
示例#4
0
 public MessagingSpace(ISubscribableRouter router, Func <T, TopLeftRectangle> getBox, IPartitioner partitioner = null)
     : this(router, x => getBox(x).Center, getBox, partitioner)
 {
 }
示例#5
0
 public MessagingSpace(ISubscribableRouter router, Func <T, Vector2> getPoint, IPartitioner partitioner = null)
     : this(router, getPoint, x => new CenteredRectangle(getPoint(x), 0, 0), partitioner)
 {
 }