Example #1
0
        private void AddLeftToUpTurn(int row, int column)
        {
            var turn = new Turn
            {
                Type     = TurnType.LeftToUp,
                Size     = new Size(50, 50),
                Location = new Point(column * 50 + column, row * 50 + row)
            };

            _workField.Controls.Add(turn);

            _map.AddElement(row, column, new Simulator.Map.Infrastructure.Turn());
            if (column - 1 >= 0)
            {
                _map.SetConnected(row, column - 1, row, column);
            }

            if (row - 1 >= 0)
            {
                _map.SetConnected(row - 1, column, row, column);
            }
        }
Example #2
0
        private void AddRightToDownTurn(int row, int column)
        {
            var turn = new Turn
            {
                Type     = TurnType.RightToDown,
                Size     = new Size(50, 50),
                Location = new Point(column * 50 + column, row * 50 + row)
            };

            _workField.Controls.Add(turn);

            _map.AddElement(row, column, new Simulator.Map.Infrastructure.Turn());
            if (column + 1 < _workingFieldNofColumns)
            {
                _map.SetConnected(row, column + 1, row, column);
            }

            if (row + 1 < _workingFieldNofRows)
            {
                _map.SetConnected(row + 1, column, row, column);
            }
        }