Exemplo n.º 1
0
        private ArrowControlFactorySet CreateSet(ViewModel.Relationship viewModelRelationship, NodeControl fromControl, NodeControl toControl)
        {
            ArrowController arrowController = new ArrowController(viewModelRelationship, fromControl, toControl);

            arrowController.ViewModel.Id = viewModelRelationship.Id;
            if (toControl != null)
            {
                toControl.LinkFromNode(fromControl);
            }
            ArrowControl arrowControl = new ArrowControl(fromControl, toControl);

            Canvas.SetZIndex(arrowControl, 40);
            arrowControl.DataContext = arrowController.ViewModel;
            if (toControl != null && toControl.ViewModelNode.State == CollapseState.None)
            {
                toControl.ViewModelNode.State = CollapseState.Expanded;
            }
            ArrowControlFactorySet set = new ArrowControlFactorySet();

            set.Relationship = viewModelRelationship;
            set.Control      = arrowControl;
            set.Controller   = arrowController;

            return(set);
        }
Exemplo n.º 2
0
 protected void RemoveArrow(ArrowControl arrowControl)
 {
     arrowControl.SrcItem.CurrentItem.RemoveOutConnection(arrowControl.DestItem.CurrentItem);
     arrowControl.DestItem.CurrentItem.InConnection = null;
     arrowControl.SrcItem = arrowControl.DestItem = null;
     areaControl.arrowCanvas.Children.Remove(arrowControl);
 }
Exemplo n.º 3
0
 //Remove node from selection
 public void RemoveArrow(ArrowControl arrowControl)
 {
     if (HasArrow(arrowControl))
     {
         ArrowControls.Remove(arrowControl);
         arrowControl.DeSelect();
     }
 }
Exemplo n.º 4
0
 //Add node to selection
 public void AddArrow(ArrowControl arrowControl)
 {
     if (!HasArrow(arrowControl))
     {
         ArrowControls.Add(arrowControl);
         arrowControl.Select();
     }
 }
Exemplo n.º 5
0
 protected FlowCommand(FlowAreaControl areaControl, ArrowControl arrowControl, SourceItemControl src,
                       SourceItemControl dest)
 {
     this.areaControl  = areaControl;
     this.arrowControl = arrowControl;
     this.src          = src;
     this.dest         = dest;
 }
Exemplo n.º 6
0
 private void OnTriggerExit2D(Collider2D other)
 {
     if (other.CompareTag("Arrow"))
     {
         isInBox      = false;
         currentArrow = null;
         typeArrow    = TypeArrow.NONE;
     }
 }
Exemplo n.º 7
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (other.CompareTag("Arrow"))
     {
         isInBox      = true;
         currentArrow = other.GetComponent <ArrowControl>();
         typeArrow    = currentArrow.typeArrow;
     }
 }
Exemplo n.º 8
0
 protected override void Connect(SourceItemControl srcItem, SourceItemControl destItem, ArrowControl arrowControl)
 {
     if (destItem != null && destItem.CurrentItem.InConnection != null)
     {
         removedArrow   = areaControl.GetArrowControl(destItem);
         removedSrcItem = removedArrow.SrcItem;
         RemoveArrow(removedArrow);
     }
     base.Connect(srcItem, destItem, arrowControl);
 }
Exemplo n.º 9
0
 void Start()
 {
     scorescript = GetComponent <Scores>();
     // Assign the component
     PowerBar = GameObject.Find("ForceBar").GetComponent <PowerBarController>();
     Line     = GameObject.Find("Line").GetComponent <ArrowControl>();
     Line.gameObject.SetActive(false);
     // Assign the Rigidbody component to our private rb variable
     rb           = GetComponent <Rigidbody>();
     LastPosition = transform.position;
 }
Exemplo n.º 10
0
 private void RelationshipRenderer_Loaded(object sender, RoutedEventArgs e)
 {
     _arrowControl                       = new ArrowControl();
     _arrowControl.DataContext           = Relationship;
     _arrowControl.ParentNavigatorView   = ParentNavigatorView;
     _arrowControl.GlowColor             = Colors.Red;
     _arrowControl.MouseLeftButtonDown  += new MouseButtonEventHandler(_arrowControl_MouseLeftButtonDown);
     _arrowControl.MouseRightButtonDown += new MouseButtonEventHandler(_arrowControl_MouseRightButtonDown);
     _arrowControl.DragFromAnchorEnded  += new RoutedEventHandler(_arrowControl_DragFromAnchorEnded);
     _arrowControl.DragToAnchorEnded    += new RoutedEventHandler(_arrowControl_DragToAnchorEnded);
     this.Children.Add(_arrowControl);
 }
Exemplo n.º 11
0
    public void InstantiateNewPallino()
    {
        GameObject pallino = Instantiate(pallinoPrefab, transform.position, Quaternion.identity)
                             as GameObject;

        pallino.transform.parent = transform;
        GetPallino();
        pallino.GetComponent <BallControl>().killCommandObserver += KillCommandHandler_BallParent;
        arrow            = transform.GetChild(0).GetComponent <ArrowControl>();
        arrow.ball       = ball;
        arrow.isRotating = true;
    }
Exemplo n.º 12
0
 void CheckForShoot()
 {
     if (poolShoot.listFreeArrows.Count > 0 && canShootCor)
     {
         ArrowControl arrow = poolShoot.listFreeArrows[0].GetComponent <ArrowControl>();
         arrow.gameObject.SetActive(true);
         arrow.transform.position = arrowPos.position;
         arrow.AddDamage(addDmg);
         arrow.SetImpulse(Vector2.right, mySprRenderer.flipX ? -1 : 1);
         canShoot = false;
         StartCoroutine(RechargeCororutine());
     }
 }
Exemplo n.º 13
0
 public static void Preserve()
 {
     CardsView.Preserve();
     CarouselView.Preserve();
     CoverFlowView.Preserve();
     ArrowControl.Preserve();
     LeftArrowControl.Preserve();
     RightArrowControl.Preserve();
     CircleFrame.Preserve();
     IndicatorItemView.Preserve();
     IndicatorsControl.Preserve();
     ParentScrollView.Preserve();
 }
Exemplo n.º 14
0
        /// <summary>
        /// click help button
        /// </summary>
        /// <param name="view">View IVIEw</param>
        /// <param name="model">model IMOdel</param>
        public Help_w(IModel model, IView view)
        {
            InitializeComponent();
            m_model = model;
            m_view  = view;
            MazeCell1    wall   = new MazeCell1();
            GrassCell    grass  = new GrassCell();
            StepsCell    steps  = new StepsCell();
            ArrowControl jumper = new ArrowControl();
            StartControl start  = new StartControl();
            EndControl   end    = new EndControl();

            Grass.Children.Add(grass);
            Wall.Children.Add(wall);
            Steps.Children.Add(steps);
            Jumper.Children.Add(jumper);
            Start.Children.Add(start);
            Goal.Children.Add(end);
        }
Exemplo n.º 15
0
    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.gameObject.CompareTag("Player"))
        {
            return;
        }

        var HealthController = other.gameObject.GetComponent <HealthController>();

        if (HealthController != null)
        {
            HealthController.ReduceHealth(damage);
        }

        ArrowControl ac = GetComponent <ArrowControl>();

        //myCollider.isTrigger = false;
        //Debug.Log(gameObject.name + " is triggered on " + other.gameObject.name);
        ac.StopArrow();
    }
Exemplo n.º 16
0
        public ArrowControlFactorySet RemoveArrow(ArrowControl arrowControl)
        {
            ViewModel.ArrowViewModel viewModelArrow = arrowControl.DataContext as ViewModel.ArrowViewModel;

            if (viewModelArrow != null)
            {
                return(RemoveArrow(viewModelArrow));
            }
            else
            {
                IEnumerable <Guid> arrowSetIds = from arrowSet in Arrows
                                                 where arrowSet.Value.Control == arrowControl
                                                 select arrowSet.Key;

                if (arrowSetIds.Any())
                {
                    return(RemoveArrow(arrowSetIds.First()));
                }
            }

            return(null);
        }
Exemplo n.º 17
0
 public void InstantiateNewBocce()
 {
     Debug.Log("Instantiating new Bocce");
     if (!isGreenTurn)
     {
         ball = Instantiate(boccePrefabGreen, transform.position, Quaternion.identity)
                as GameObject;
         ball.GetComponent <BocceControl>().isGreen = true;
         isGreenTurn = true;
     }
     else
     {
         ball = Instantiate(boccePrefabRed, transform.position, Quaternion.identity)
                as GameObject;
         ball.GetComponent <BocceControl>().isGreen = false;
         isGreenTurn = false;
     }
     ball.transform.parent = transform;
     ball.GetComponent <BallControl>().killCommandObserver += KillCommandHandler_BallParent;
     arrow            = transform.GetChild(0).GetComponent <ArrowControl>();
     arrow.ball       = ball;
     arrow.isRotating = true;
 }
Exemplo n.º 18
0
 public RemoveFlowCommand(FlowAreaControl areaControl, ArrowControl arrowControl)
     : base(areaControl, arrowControl, arrowControl.SrcItem, arrowControl.DestItem)
 {
 }
Exemplo n.º 19
0
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="control"></param>
 public AccessModeEditor(ArrowControl <IEnclosesNameSpaces, NameSpace, AccessMode> control)
     : base(control)
 {
 }
Exemplo n.º 20
0
 public bool HasArrow(ArrowControl arrowControl)
 {
     return(ArrowControls.Contains(arrowControl));
 }
Exemplo n.º 21
0
 CreateArrowEditor(ArrowControl <IHoldsRequirementSets, RequirementSet, RequirementSetDependancy> control)
 {
     return(new TransitionEditor(control));
 }
Exemplo n.º 22
0
        protected virtual void Connect(SourceItemControl srcItem, SourceItemControl destItem, ArrowControl arrowControl)
        {
            arrowControl.SrcItem = srcItem;
            if (srcItem != null)
            {
                srcItem.CurrentItem.AddOutConnection(new Connection {
                    Target = destItem.CurrentItem
                });
            }

            arrowControl.SrcItem              = srcItem;
            arrowControl.DestItem             = destItem;
            destItem.CurrentItem.InConnection = new Connection {
                Target = srcItem.CurrentItem
            };
            if (!areaControl.arrowCanvas.Children.Contains(arrowControl))
            {
                areaControl.arrowCanvas.Children.Add(arrowControl);
            }
        }
Exemplo n.º 23
0
 /// <summary>
 ///     Factory for arrow editor
 /// </summary>
 /// <param name="control"></param>
 /// <returns></returns>
 protected override ArrowEditor <IEnclosesNameSpaces, NameSpace, AccessMode> CreateArrowEditor(
     ArrowControl <IEnclosesNameSpaces, NameSpace, AccessMode> control)
 {
     return(new AccessModeEditor(control));
 }
Exemplo n.º 24
0
 public AddFlowCommand(FlowAreaControl areaControl, ArrowControl arrowControl, SourceItemControl src,
                       SourceItemControl dest)
     : base(areaControl, arrowControl, src, dest)
 {
 }
Exemplo n.º 25
0
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="control"></param>
 public TransitionEditor(ArrowControl <IHoldsRequirementSets, RequirementSet, RequirementSetDependancy> control)
     : base(control)
 {
 }
Exemplo n.º 26
0
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="control"></param>
 public TransitionEditor(ArrowControl <StateMachine, State, Transition> control)
     : base(control)
 {
 }
Exemplo n.º 27
0
 /// <summary>
 ///     Factory for arrow editor
 /// </summary>
 /// <param name="control"></param>
 /// <returns></returns>
 protected override ArrowEditor <StateMachine, State, Transition> CreateArrowEditor(
     ArrowControl <StateMachine, State, Transition> control)
 {
     return(new TransitionEditor(control));
 }