Add util method for checking if cell can be fired upon (#2)

issue-2
Garrett Mills 4 years ago
parent 99759bad09
commit a4f13f0d17
Signed by: garrettmills
GPG Key ID: D2BF5FBA8298F246

@ -35,6 +35,18 @@ export function isShipCell(grid_cell_state) {
].includes(grid_cell_state)
}
/**
* Returns true if the given grid cell state can be fired upon.
* @param {GridCellState} grid_cell_state
* @return {boolean}
*/
export function isValidTargetCell(grid_cell_state) {
return [
GridCellState.Ship,
GridCellState.Available,
].includes(grid_cell_state)
}
/**
* Enum of all possible players.
* @type {object}

Loading…
Cancel
Save