Exemple #1
0
        public Cell(int num, StateEdge stateEdge)
        {
            Weight = 1;
            if (stateEdge == StateEdge.Edge)
            {
                this.Background = new SolidColorBrush(Colors.White);
                CurrColor       = Colors.White;
            }
            if (stateEdge == StateEdge.Wall)
            {
                this.Background = new SolidColorBrush(Colors.Gray);
                CurrColor       = Colors.Gray;
            }
            if (stateEdge == StateEdge.StartPoint)
            {
                this.Background = new SolidColorBrush(Colors.Blue);
                CurrColor       = Colors.Blue;
            }
            if (stateEdge == StateEdge.EndPoint)
            {
                this.Background = new SolidColorBrush(Colors.Red);
                CurrColor       = Colors.Red;
            }


            this.BorderBrush     = new SolidColorBrush(Colors.Black);
            this.BorderThickness = new Thickness(1);

            TypeEdge = stateEdge;
            Num      = num;
        }
Exemple #2
0
 public void ChangeType(StateEdge state)
 {
     if (state == StateEdge.Edge)
     {
         ChangeColor(Colors.White);
         TypeEdge = state;
     }
     else if (state == StateEdge.Wall)
     {
         ChangeColor(Colors.Gray);
         TypeEdge = state;
     }
     else if (state == StateEdge.StartPoint)
     {
         ChangeColor(Colors.Green);
         TypeEdge = state;
     }
     else if (state == StateEdge.EndPoint)
     {
         ChangeColor(Colors.Red);
         TypeEdge = state;
     }
 }
Exemple #3
0
 //Will add an edge to the FSM
 public void addEdge(StateEdge edge)
 {
     edges.Add (edge);
 }