Methods
addNewFireEvent(fireSize, startDate, coords, description, telephoneNumber, reporterName) → {object}
A function to submit a new FireEvent.
Parameters:
Name | Type | Description |
---|---|---|
fireSize |
number |
The size of the fire |
startDate |
Date |
The Date of submittion (should be an instance of the Date class). |
coords |
||
description |
string |
of the fire. |
telephoneNumber |
string |
of the reporter. |
reporterName |
string |
of the reporter. |
finishOperationOnFireEvent(id, finishTime, newkmTraveled) → {object}
The final function in state-changing functions for the FireEvents. Makes copies of the workers by VALUE.
Parameters:
Name | Type | Description |
---|---|---|
id |
number | |
finishTime |
Date | |
newkmTraveled |
number |
getFireEventByID(id) → {object}
Returns the FireEvent with the specified id.
Parameters:
Name | Type | Description |
---|---|---|
id |
number |
The id of the FireEvent you want to get. |
getFireEventsByState(state) → {Array.<object>}
Returns an array of all the fires that match the state u provided.
Parameters:
Name | Type | Description |
---|---|---|
state |
string |
rejectFireEvent(id)
A function that rejects the FireEvent with the given id.
Parameters:
Name | Type | Description |
---|---|---|
id |
number |
startOperationOnFireEvent(id, startOperationTime, driver, fireFighter1, fireFighter2, fireTruck) → {object}
Engages operation on the specified FireEvent if it is eligible for that.
Parameters:
Name | Type | Description |
---|---|---|
id |
number |
The id of the FireEvent you want target. |
startOperationTime |
Date |
The time of start. |
driver |
FireWorker | |
fireFighter1 |
FireWorker | |
fireFighter2 |
FireWorker | |
fireTruck |
FireTruck |
validateFireEvent(id) → {object}
Validates the FireEvent with the given id.
Parameters:
Name | Type | Description |
---|---|---|
id |
number |
The id of the FireEvent you want to validate. |