Esempio n. 1
0
        public override void MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            Segment segment = SenderToSegment(sender);
            _selectionEnd = _selectionStart = segment;

            UpdateSelectionPreview();
        }
Esempio n. 2
0
 public override void ClearPreview()
 {
     if (_previewSegment != null)
     {
         _previewSegment.Preview = false;
         _previewSegment = null;
     }
 }
Esempio n. 3
0
File: Room.cs Progetto: OlekNg/AHMED
        public void AddSegment(Segment segment)
        {
            if (segment.Room != null)
                throw new InvalidOperationException("Segment has already assigned room.");

            Segments.Add(segment);
            segment.Room = this;
        }
Esempio n. 4
0
 public override void ClearPreview()
 {
     if (_selectionStart != null)
     {
         _selectionStart = _selectionEnd = null;
         UpdateSelectionPreview();
     }
 }
Esempio n. 5
0
        public Segment(Floor owner, Segment segment)
            : this(owner)
        {
            Danger = segment.Danger;
            DangerValue = segment.DangerValue;
            Capacity = segment.Capacity;
            PeopleCount = segment.PeopleCount;
            Type = segment.Type == SegmentType.NONE ? SegmentType.NONE : SegmentType.FLOOR;

            LeftSide = new SideElement(segment.LeftSide);
            TopSide = new SideElement(segment.TopSide);
            RightSide = new SideElement(segment.RightSide);
            BottomSide = new SideElement(segment.BottomSide);

            Fenotype = segment.Fenotype;
            FenotypeIndex = segment.FenotypeIndex;
        }
Esempio n. 6
0
        public override void MouseMove(object sender, System.Windows.Input.MouseEventArgs e)
        {
            SegmentSide segmentSide = ProcessEventArg(sender, e);
            var segment = segmentSide.Segment;

            if (_previewSegment != null)
                _previewSegment.Preview = false;

            _previewSegment = segment;
            segment.Preview = true;
            segment.PreviewType = SegmentType.STAIRS;
            segment.PreviewOrientation = segmentSide.Side;
        }
Esempio n. 7
0
 /// <param name="peopleSegment">Segment with people count > 0</param>
 public PeoplePath(Segment peopleSegment)
 {
     _segment = peopleSegment;
 }
Esempio n. 8
0
 public override void MouseMove(object sender, System.Windows.Input.MouseEventArgs e)
 {
     if (_selectionStart != null)
     {
         _selectionEnd = SenderToSegment(sender);
         UpdateSelectionPreview();
     }
     else
     {
         var segment = SenderToSegment(sender);
         segment.PreviewType = _previewType;
         segment.Preview = true;
     }
 }
Esempio n. 9
0
 public override void MouseUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
 {
     _selectionStart = _selectionEnd = null;
     Apply();
     UpdateSelectionPreview();
 }
Esempio n. 10
0
        protected void DrawSolutionPath(Segment segment)
        {
            while (segment != null && segment.Solution == false)
            {
                // If encountered stairs, then move to segment where are second stairs from pair.
                if (segment.Type == SegmentType.STAIRS)
                {
                    StairsPair pair = segment.AdditionalData as StairsPair;
                    if (segment == pair.First.AssignedSegment)
                        segment = pair.Second.AssignedSegment;
                    else
                        segment = pair.First.AssignedSegment;

                    // Stairs have no fenotype, so we have to use orientation.
                    segment.Solution = true;
                    segment = segment.GetNeighbour(segment.Orientation);
                }

                segment.Solution = true;
                segment = segment.GetNeighbour(segment.Fenotype);
            }
        }
Esempio n. 11
0
 public override void MouseMove(object sender, System.Windows.Input.MouseEventArgs e)
 {
     _mouseoverSegment = SenderToSegment(sender);
     UpdateSelectionPreview();
 }
Esempio n. 12
0
 public override void ClearPreview()
 {
     _mouseoverSegment = null;
     UpdateSelectionPreview();
 }