# EnemyCommandPhase | pokemon-rogue-battle
Documentation for pokemon-rogue-battle

# Class EnemyCommandPhase

Phase for determining an enemy AI's action for the next turn. During this phase, the enemy decides whether to switch (if it has a trainer) or to use a move from its moveset.

For more information on how the Enemy AI works, see docs/enemy-ai.md

#### See

- Pokemon.getMatchupScore
- EnemyPokemon.getNextMove

#### Hierarchy (View Summary)

- FieldPhase
  - EnemyCommandPhase

- Defined in src/phases/enemy-command-phase.ts:17

##### Index

### Constructors

constructor

### Properties

fieldIndex
skipTurn

### Methods

end
executeForAll
getFieldIndex
hideEnemyTrainer
showEnemyTrainer
start

## Constructors

### constructor

- new EnemyCommandPhase(fieldIndex: number): EnemyCommandPhase

  #### Parameters

  - fieldIndex: number

  #### Returns EnemyCommandPhase

  Overrides FieldPhase.constructor

  - Defined in src/phases/enemy-command-phase.ts:21

## Properties

### `Protected` fieldIndex

fieldIndex: number

- Defined in src/phases/enemy-command-phase.ts:18

### `Protected` skipTurn

skipTurn: boolean = false

- Defined in src/phases/enemy-command-phase.ts:19

## Methods

### end

- end(): void

  #### Returns void

  Inherited from FieldPhase.end

  - Defined in src/phase.ts:6

### executeForAll

- executeForAll(func: PokemonFunc): void

  #### Parameters

  - func: PokemonFunc

  #### Returns void

  Inherited from FieldPhase.executeForAll

  - Defined in src/phases/field-phase.ts:8

### getFieldIndex

- getFieldIndex(): number

  #### Returns number

  - Defined in src/phases/enemy-command-phase.ts:106

### hideEnemyTrainer

- hideEnemyTrainer(): void

  #### Returns void

  Inherited from FieldPhase.hideEnemyTrainer

  - Defined in src/phases/battle-phase.ts:37

### showEnemyTrainer

- showEnemyTrainer(trainerSlot?: TrainerSlot ): void

  #### Parameters

  - trainerSlot: TrainerSlot = TrainerSlot.NONE

  #### Returns void

  Inherited from FieldPhase.showEnemyTrainer

  - Defined in src/phases/battle-phase.ts:10

### start

- start(): void

  #### Returns void

  Overrides FieldPhase.start

  - Defined in src/phases/enemy-command-phase.ts:30