void setSquare(String square, bool state) { int sqIndex = ChessnutProtocol.squares.indexOf(square.toLowerCase()); if (sqIndex == -1) throw Exception("Square not found."); _pattern[sqIndex] = state; }