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

            UpdateSelectionPreview();
        }
Example #2
0
 public override void ClearPreview()
 {
     if (_previewSegment != null)
     {
         _previewSegment.Preview = false;
         _previewSegment = null;
     }
 }
Example #3
0
File: Room.cs Project: 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;
        }
Example #4
0
 public override void ClearPreview()
 {
     if (_selectionStart != null)
     {
         _selectionStart = _selectionEnd = null;
         UpdateSelectionPreview();
     }
 }
Example #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;
        }
Example #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;
        }
Example #7
0
 /// <param name="peopleSegment">Segment with people count > 0</param>
 public PeoplePath(Segment peopleSegment)
 {
     _segment = peopleSegment;
 }
Example #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;
     }
 }
Example #9
0
 public override void MouseUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
 {
     _selectionStart = _selectionEnd = null;
     Apply();
     UpdateSelectionPreview();
 }
Example #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);
            }
        }
Example #11
0
 public override void MouseMove(object sender, System.Windows.Input.MouseEventArgs e)
 {
     _mouseoverSegment = SenderToSegment(sender);
     UpdateSelectionPreview();
 }
Example #12
0
 public override void ClearPreview()
 {
     _mouseoverSegment = null;
     UpdateSelectionPreview();
 }