示例#1
0
 void s_Links(DirectionValue direction, List <Pair <PositionValue, PositionValue> > positionpairs)
 {
     foreach (var pospair in positionpairs)
     {
         _boarddef.AddLink(direction, pospair.Item1, pospair.Item2);
     }
 }
示例#2
0
 void AddLinks(int dirindex, string fromname, string toname, int level, BoardDef board)
 {
     for (int i = 0; i < _names[level].Count; i++)
     {
         var j = i + _diroffs[dirindex][level];
         if (j >= 0 && j < _names[level].Count)
         {
             var fname = fromname + _names[level][i];
             var tname = toname + _names[level][j];
             if (level == _names.Count - 1)
             {
                 board.AddLink(_directions[dirindex], board.GetPosition(fname), board.GetPosition(tname));
             }
             else
             {
                 AddLinks(dirindex, fname, tname, level + 1, board);
             }
         }
     }
 }