You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 26, 2025. It is now read-only.
I've been tinkering with the Sweeper demo (com/google/foam/demos/sweeper) and it looks like it does have logic programmed to clear neighbouring squares but it's not working.
Here's the affected logic in Board.js:
function cellUncovered(e) {
var cell = e.src;
if ( cell.mineCount ) return;
this.setTimeout(
this.forEachNeighbour.bind(
this,
cell,
function(c) { if ( ! c.mined ) c.covered = false; }),
32);
}
I was able to fix the demo by adding the line cell = cell.obj.instance_; underneath var cell = e.src, as it looks like it's e.src.obj.instance_ which has all the properties in it.
I'm new to Foam, so I'm wondering if this is the correct way to solve the problem, and whether it's an error in the demo or if Foam is supposed to be moving properties up to e.src. If this is the correct solution I'd be happy to submit a PR.