Exemple #1
0
        public char this[Position position]
        {
            get
            {
                return this.matrix[position.Row, position.Col];
            }

            private set
            {
                this.matrix[position.Row, position.Col] = value;
            }
        }
Exemple #2
0
        public bool CanMoveTo(Position position)
        {
            if (position.Row < 0 || position.Row >= this.matrix.GetLength(0))
            {
                return false;
            }

            if (position.Col < 0 || position.Col >= this.matrix.GetLength(1))
            {
                return false;
            }

            if (this[position] == '1' || this.IsVisisted(position))
            {
                return false;
            }

            return true;
        }
Exemple #3
0
 public bool IsVisisted(Position position)
 {
     return this.visited[position.Row, position.Col];
 }
Exemple #4
0
 public void Visit(Position position)
 {
     this.visited[position.Row, position.Col] = true;
 }