Beispiel #1
0
        public override bool Equals(object obj)
        {
            Node objNode = (Node)obj;

            if (position.Equals(objNode.position))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
    private void createLogicalMaze()
    {
        int r = Random.Range(0, 2) * (ROWS - 1);
        int c = Random.Range(0, 2) * (COLS - 1);
        int l = Random.Range(0, LAYS);

        _endCell   = _maze.CellAt(r, c, l);
        _startCell = _endCell;
        while (!_endCell.Equals(_startCell))
        {
            r          = Random.Range(0, 2) * (ROWS - 1);
            c          = Random.Range(0, 2) * (COLS - 1);
            l          = Random.Range(0, LAYS);
            _startCell = _maze.CellAt(r, c, l);
        }
        createLogicalMaze(_endCell);
    }