MCPcopy
hub / github.com/Effect-TS/effect / removeMine

Function removeMine

packages/cli/examples/naval-fate/store.ts:113–121  ·  view source on GitHub ↗
(x, y)

Source from the content-addressed store, hash-verified

111 })
112
113 const removeMine: NavalFateStore["removeMine"] = (x, y) =>
114 Effect.gen(function*() {
115 const mines = yield* getMines
116 const mineAtCoords = Arr.findFirstIndex(mines, (mine) => mine.hasCoordinates(x, y))
117 if (Option.isSome(mineAtCoords)) {
118 const newMines = Arr.remove(mines, mineAtCoords.value)
119 yield* setMines(newMines)
120 }
121 })
122
123 return NavalFateStore.of({
124 createShip,

Callers 1

naval-fate.tsFile · 0.85

Calls 3

setMinesFunction · 0.85
removeMethod · 0.65
hasCoordinatesMethod · 0.45

Tested by

no test coverage detected