A redacted clone of a board: every tile is kept (same count, same tree position - nothing is removed, so it
stays renderable and clickable exactly like a local board), but hasShip is set to false on any tile that is
neither hit nor on the viewer's own board. Which cells to redact is read from the real board, matching the
rule the robot's own targeting already follows (see robot/densityTargets.ts's buildShotState), generalized
from "what the AI may read" to "what a remote viewer may be sent" - only the hidden tiles' hasShip is mutated
on the clone.
setViewShip (src/cells/setViewShip.ts) also bakes a grey backgroundColor directly onto a ship tile's own
attributes.style the moment it is placed - meant for local play, where seeing your own ship as you place it
is the point. That baked style survives this clone untouched unless cleared here too, which would leak every
unhit ship's exact position through the rendered colour even with hasShip correctly hidden - clearing it only
for the same cells hasShip is cleared for keeps a legitimate hit's own red/white colouring (set afterwards by
colourHitCell, both colours equally public) untouched.
Parameters
board: Matrix
ownBoard: boolean
whether the viewer this is being redacted for owns this board
A redacted clone of a board: every tile is kept (same count, same tree position - nothing is removed, so it stays renderable and clickable exactly like a local board), but hasShip is set to false on any tile that is neither hit nor on the viewer's own board. Which cells to redact is read from the real board, matching the rule the robot's own targeting already follows (see robot/densityTargets.ts's buildShotState), generalized from "what the AI may read" to "what a remote viewer may be sent" - only the hidden tiles' hasShip is mutated on the clone.
setViewShip (src/cells/setViewShip.ts) also bakes a grey
backgroundColordirectly onto a ship tile's ownattributes.stylethe moment it is placed - meant for local play, where seeing your own ship as you place it is the point. That baked style survives this clone untouched unless cleared here too, which would leak every unhit ship's exact position through the rendered colour even with hasShip correctly hidden - clearing it only for the same cells hasShip is cleared for keeps a legitimate hit's own red/white colouring (set afterwards by colourHitCell, both colours equally public) untouched.