# Class Navigator<T>

#### Type Parameters

- #### T = number

#### Hierarchy

- Navigator

- Defined in src/data-structures/matrix/navigator.ts:28

#####
Index

### Constructors

constructor

### Properties

_VISITED
_character
_cur
_matrix
onMove

### Methods

check
move
start

## Constructors

### constructor

- new Navigator<T>(-): Navigator<T>

- The constructor initializes the Navigator object with the given parameters and sets the current position as visited in the matrix.

  #### Type Parameters

  - #### T = number

  #### Parameters

  - ##### -: NavigatorParams<T>

    `matrix`: a 2D array representing the grid or map

  #### Returns Navigator<T>

  - Defined in src/data-structures/matrix/navigator.ts:40

## Properties

### `Private` `Readonly` _VISITED

_VISITED: T

- Defined in src/data-structures/matrix/navigator.ts:33

### `Private` _character

_character: Character

- Defined in src/data-structures/matrix/navigator.ts:32

### `Private` `Readonly` _cur

_cur: [number, number]

- Defined in src/data-structures/matrix/navigator.ts:31

### `Private` `Readonly` _matrix

_matrix: T[][]

- Defined in src/data-structures/matrix/navigator.ts:30

### onMove

onMove: ((cur) => void)

#### Type declaration

- - (cur): void

  - #### Parameters

    - ##### cur: [number, number]

    #### Returns void

- Defined in src/data-structures/matrix/navigator.ts:29

## Methods

### check

- check(direction): boolean

- The function checks if there is a valid move in the specified direction in a matrix.

  #### Parameters

  - ##### direction: Direction

    The direction parameter is a string that represents the direction in which to check. It can be one of the following values: 'up', 'right', 'down', or 'left'.

  #### Returns boolean

  a boolean value.

  - Defined in src/data-structures/matrix/navigator.ts:71

### move

- move(direction): void

- The `move` function updates the current position based on the given direction and updates the matrix accordingly.

  #### Parameters

  - ##### direction: Direction

    The `direction` parameter is a string that represents the direction in which to move. It can have one of the following values: 'up', 'right', 'down', or 'left'.

  #### Returns void

  - Defined in src/data-structures/matrix/navigator.ts:101

### start

- start(): void

- The "start" function moves the character in its current direction until it encounters an obstacle, then it turns the character and repeats the process.

  #### Returns void

  - Defined in src/data-structures/matrix/navigator.ts:54

Generated using TypeDoc