//--- sexpr api and data void s_Dummy(List <PositionValue> positions) { foreach (var pos in positions) { _boarddef.SetPosition(pos, Rect.Empty); } }
// Recursive walk to add positions void AddPositions(string basename, Rect baserect, List <int> basecoords, int level, BoardDef board) { for (int i = 0; i < _names[level].Count; i++) { var name = basename + _names[level][i]; var rect = baserect.Offset(_coords[level].Times(i)); var coords = new List <int>(basecoords); coords.Add(i); //var coords_ = coords.AsEnumerable().Concat(new int[] { i }).ToList(); if (level == _names.Count - 1) { board.SetPosition(board.GetPosition(name), rect, coords); } else { AddPositions(name, rect, coords, level + 1, board); } } }