michaelkirk/weiqi — pull request #27 by svevang (2014-12-19 19:38:36+00:00)
Title: keep the cell_views indexed by position, remove reverse view relation

This is motivated by 8a79416bce3837b8529852081eda6987748b77f0 which is part of a WIP of another branch. The problem is that we are synchronizing the board state across the `update-board` event. When this event is fired the board reinitializes its state, rebuilding the cell arrays, but does not reinit the associated views. This breaks all the reverse view relations on the cell_views that point to the cells.

Anyways, reverse relations shouldn't be needed. The approach in this PR is to break the relation by indexing both the cells and the cell_views on their position in the board. This way we can join without worrying about stale relations.