コード例 #1
0
    int GameControllerStandard::diagRightLeft(int x, int y, data::IPlayer *p) // '\'
    {
        int sum = 0;

        countCells(x, y, p, +1, +1); // First to right down
        countCells(x-1, y-1, p, -1, -1); // Than to left up
        // (dont count double)

        return sum;
    }
コード例 #2
0
    int GameControllerStandard::horizontal(int x, int y, data::IPlayer *p) // '-'
    {
        int sum = 0;

        sum = countCells(x, y, p, -1, 0);
        sum += countCells(x+1, y, p, +1, 0);
        // (dont count double)

        return sum;
    }
コード例 #3
0
ファイル: main_tests.cpp プロジェクト: cosmi/hp3d2
void initializeCellSpace(int size) {
    auto cs = CellNodeSpace<DIMS>();
    cs.initWithOneCell(size);
    CHECK("Has only one cell", cs.countCells() == 1);
    auto bounds = cs.getBounds();
    CHECK("Is cube", bounds.isCube());
    CHECK("Has correct size", bounds.getSide() == 1<<size);
}
コード例 #4
0
 int GameControllerStandard::down(int x, int y, data::IPlayer *p)
 {
     return countCells(x, y, p, 0, 1);
 }