コード例 #1
0
 private void ChangeColor(ColorState color, int i, int j, int di, int dj)
 {
     i += di;
     j += dj;
     while (fields[i, j].ToColor() != color)
     {
         fields[i, j] = color.ToFieldState();
         i           += di;
         j           += dj;
     }
 }
コード例 #2
0
    internal int CalcPieces(ColorState color)
    {
        FieldState pieceColor = color.ToFieldState();
        int        pieces     = 0;

        foreach (var f in fields)
        {
            if (f == pieceColor)
            {
                pieces++;
            }
        }
        return(pieces);
    }