WorkerManager

WorkerManager

Class representing a manager for the FireWorkers.

Constructor

new WorkerManager()

Source:

Methods

addNewWorker(FireWorker)

Adds a new FireWorker instance to the workers array.

Parameters:
Name Type Description
FireWorker FireWorker

Provide an instance of the class FireWorker.

Source:

getAllWorkersByRole(role) → {Array.<Worker>}

Returns an array containing all of the workers with the specified role.

Parameters:
Name Type Description
role string

The role to search with.

Source:

getWorkerByID(id)

Returns a worker with the specified ID.

Parameters:
Name Type Description
id number

The id of the user you want to get.

Source:

removeWorker(id) → {FireWorker}

A function to remove a FireWorker from the list. The FireWorker must be available to be removed.

Parameters:
Name Type Description
id number
Source: