# Class: AddPlayersComponent

## AddPlayersComponent()

A component which represents the "Add Players" page. Allows users to add/remove players from their team.

## Constructor

#### new AddPlayersComponent()

Source:
  - frontend/src/components/pages/AddPlayers.component.js, line 60

### Extends

- Component

### Members

#### all_players :Array.<object>

All available players, whether they are on the user's team or not.

##### Type:

- Array.<object>

Source:
  - frontend/src/components/pages/AddPlayers.component.js, line 99

#### filtered_players :Array.<object>

Array of currently displayed players, after the filter has been applied.

##### Type:

- Array.<object>

Source:
  - frontend/src/components/pages/AddPlayers.component.js, line 87

#### my_team :Array.<object>

Array of players currently on the user's team.

##### Type:

- Array.<object>

Source:
  - frontend/src/components/pages/AddPlayers.component.js, line 81

#### my_team_only :boolean

If true, then only the players on the user's team will be shown.

##### Type:

- boolean

Source:
  - frontend/src/components/pages/AddPlayers.component.js, line 75

#### possible_players :Array.<object>

Array of currently displayed players, before the filter has been applied.

##### Type:

- Array.<object>

Source:
  - frontend/src/components/pages/AddPlayers.component.js, line 93

#### quick_filter :string

The current value of the quick filter for players. If empty string, no filter is applied.

##### Type:

- string

Source:
  - frontend/src/components/pages/AddPlayers.component.js, line 69

### Methods

#### add_to_team(player)

Add the given player to the user's team, if not already there.

##### Parameters:

Name | Type | Description
--- | --- | ---
`player` | object |

Source:
  - frontend/src/components/pages/AddPlayers.component.js, line 151

#### on_filter_change()

Called when the quick-filter changes. Applies the filter to the displayed players.

Source:
  - frontend/src/components/pages/AddPlayers.component.js, line 121

#### on_photo_hover(player)

Called when the user hovers over a player. Toggles the stats to be shown.

##### Parameters:

Name | Type | Description
--- | --- | ---
`player` | object |

Source:
  - frontend/src/components/pages/AddPlayers.component.js, line 171

#### on_photo_leave(player)

Called when the user un-hovers over a player. Toggles the stats to hide.

##### Parameters:

Name | Type | Description
--- | --- | ---
`player` | object |

Source:
  - frontend/src/components/pages/AddPlayers.component.js, line 179

#### remove_from_team(player)

Remove the given player from the user's team, if there.

##### Parameters:

Name | Type | Description
--- | --- | ---
`player` | object |

Source:
  - frontend/src/components/pages/AddPlayers.component.js, line 161

#### to_all_players()

When called, change the display to show all available players.

Source:
  - frontend/src/components/pages/AddPlayers.component.js, line 141

#### to_my_team_only()

When called, change the display to show only the user's team.

Source:
  - frontend/src/components/pages/AddPlayers.component.js, line 132

#### (async) vue_on_create() → {Promise.<void>}

Called when the page is instantiated.

Source:
  - frontend/src/components/pages/AddPlayers.component.js, line 105

##### Returns:

Type
  Promise.<void>