Esempio n. 1
0
static void drawCube(int row, int col, char ch, bool invert) {
   drawAndFillRoundedRect(cubeX(col), cubeY(row),
                          gState.cubeSize, gState.cubeSize,
                          gState.cubeSize/5.0,
                          invert ? LETTER_COLOR : DIE_COLOR);
   gwp->setColor(invert ? DIE_COLOR : LETTER_COLOR);
   drawCenteredChar(cubeX(col) + gState.cubeSize/2.0,
                    cubeY(row) + gState.cubeSize/2.0, ch);
}
Esempio n. 2
0
unsigned int Hexagon::orientationTo(Hexagon* hexagon)
{
    int dx = hexagon->cubeX() - cubeX();
    int dy = hexagon->cubeY() - cubeY();

    switch(dx)
    {
        case 0: // 0 || 3
        {
            return dy == 1 ? 0 : 3;
        }
        case 1: // 1 || 2
        {
            return dy == 0 ? 1 : 2;
        }
        case -1: // 4 || 5
        {
            return dy == 0 ? 4 : 5;
        }
    }
    return 0;
}