Ejemplo n.º 1
0
        private void DetermineStepDirection(MapCoordinates start, MapCoordinates end)
        {
            int spanRow    = Math.Abs(start.Row - end.Row);
            int spanColumn = Math.Abs(start.Column - end.Column);

            _dirStep = spanRow > spanColumn ? Dir.Vert : Dir.Horiz;
            Dir dirOther = MapCoordinates.OtherDirection(_dirStep);

            _incLong                  = _incShort = new MapCoordinates();
            _incLong[_dirStep]        = start[_dirStep] < end[_dirStep] ? 1 : -1;
            _incShort[dirOther]       = start[dirOther] < end[dirOther] ? 1 : -1;
            _pureHorizontalOrVertical = start.Row == end.Row || start.Column == end.Column;
            _largeValue               = Math.Max(spanColumn, spanRow);
            _smallValue               = Math.Min(spanColumn, spanRow);
            _tally = _largeValue / 2;
        }