本文整理汇总了C++中GoBoard::getSpeculativePiece方法的典型用法代码示例。如果您正苦于以下问题:C++ GoBoard::getSpeculativePiece方法的具体用法?C++ GoBoard::getSpeculativePiece怎么用?C++ GoBoard::getSpeculativePiece使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GoBoard
的用法示例。
在下文中一共展示了GoBoard::getSpeculativePiece方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawPieces
void Mesh::DrawPieces(GoBoard &board) {
glTranslatef(PIECE_OFFSET, BOARD_HEIGHT, PIECE_OFFSET);
glScalef(PIECE_X_SCALE, PIECE_Y_SCALE, PIECE_Z_SCALE);
//glTranslatef(0.5f, 0.5f, 0.5f);
for (int x = 0; x < 9; x++) {
for (int y = 0; y < 9; y++) {
char space = board.getPiece(x, y);
if (space != 0) {
float color = (space + 1) / 2 + 0.2;
glColor3f(color, color, color);
DrawMesh(piece, piece_tri_verts_VBO);
//glutSolidSphere(0.5, 10, 10);
}
glTranslatef(0, 0, BOARD_GRID_SPACING);
}
glTranslatef(0, 0, -BOARD_MAX/PIECE_Z_SCALE);
glTranslatef(BOARD_GRID_SPACING, 0, 0);
}
glTranslatef(-BOARD_MAX/PIECE_X_SCALE, 0, 0);
auto sP = board.getSpeculativePiece();
//if (board.legalMove(sP.second, sP.first.first, sP.first.second)) {
glTranslatef(BOARD_GRID_SPACING*sP.first.x, 0, BOARD_GRID_SPACING*sP.first.y);
float color = (sP.second + 1) / 2 + 0.2;
glColor3f(color, 0, color);
//glutSolidSphere(0.5, 10, 10);
DrawMesh(piece, piece_tri_verts_VBO);
//}
//endTranslate();
}