Example #1
0
void prepare(TestInfo info)
{
    //Loading::initRW();
    ADDeviceEmulator::runLater(1.5f, [info]() {
        info.finish();
    });
}
Example #2
0
void playGame(TestInfo info,
              const char* table)
{
    TableCells table_cells;
    int x=0;
    int y=0;
    int max_ell = Cell::N -1;
    for(int i=0; i<Cell::N*Cell::N; ++i)
    {
        x = i%4;
        y =  max_ell - i/4;
        if(table[i] != '-')
        {
            Letter curr_letter(table[i]);
            table_cells.setLetter(x,y,curr_letter);
        }
    }
    int64_t score = 25000;

    SessionManager::getInstance()->beginTheGame();
    SessionManager::getInstance()->tableChanged(table_cells);
    SessionManager::getInstance()->scoreChanged(score);

    CCDirector::sharedDirector()->replaceScene(PlayScene::scene(GameMode::Continue));

    ADDeviceEmulator::runLater(1.5f, [info](){
            ADDeviceEmulator::createScreenShoot(info);
            info.finish();
        });
}
Example #3
0
void purchaseBuy(TestInfo info)
{
    CCDirector::sharedDirector()->replaceScene(SettingsScene::scene(true));
    ADDeviceEmulator::runLater(2.5f, [info](){

        ADDeviceEmulator::createScreenShoot(info);
        info.finish();
    });
}
Example #4
0
void openSettings(TestInfo info)
{
    CCDirector::sharedDirector()->replaceScene(SettingsScene::scene());
    ADDeviceEmulator::runLater(1.5f, [info](){

        ADDeviceEmulator::createScreenShoot(info);
        info.finish();
    });
}
Example #5
0
void continueGame(TestInfo info)
{
    CCDirector::sharedDirector()->replaceScene(PlayScene::scene(GameMode::Continue));
    ADDeviceEmulator::runLater(1.5f, [info](){

        ADDeviceEmulator::createScreenShoot(info);
        info.finish();
    });
}
Example #6
0
void openLevelScene(TestInfo info, CollectionID id, int difficulty)
{
    CCDirector::sharedDirector()->replaceScene(LevelScene::scene(id,difficulty));
    ADDeviceEmulator::runLater(2.5f, [info](){

        ADDeviceEmulator::createScreenShoot(info);
        info.finish();
    });
}
Example #7
0
void openAllCollectionsScene(TestInfo info)
{
    CCDirector::sharedDirector()->replaceScene(SelectCollection::scene());
    ADDeviceEmulator::runLater(2.5f, [info](){

        ADDeviceEmulator::createScreenShoot(info);
        info.finish();
    });
}
Example #8
0
void openMainScene(TestInfo info)
{
    CCDirector::sharedDirector()->replaceScene(MainMenu::scene());
    ADDeviceEmulator::runLater(2.5f, [info]() {

        ADDeviceEmulator::createScreenShoot(info);
        info.finish();
    });
}
Example #9
0
void openOneCollectionScene(TestInfo info,
                            int collection_number)
{
    Collection* collection = RW::getCollectionByIndex(collection_number);

    CCDirector::sharedDirector()->replaceScene(SelectLevel::scene(collection));
    ADDeviceEmulator::runLater(2.5f, [info]() {

        ADDeviceEmulator::createScreenShoot(info);
        info.finish();
    });
}
Example #10
0
void openAllCollectionScene(TestInfo info,
                            bool first_collections)
{
    // 'scene' is an autorelease object
    CCScene *scene = CCScene::create();

    // 'layer' is an autorelease object
    SelectCollection *layer = SelectCollection::create();

    BackgroundHolder::backgroundSwitchTo(scene,0,false);
    scene->addChild(layer);
    CCDirector::sharedDirector()->replaceScene(scene);

    //move scroll zone
    if(!first_collections)
        layer->moveCollectionScrollZone();

    ADDeviceEmulator::runLater(4.5f, [info]() {

        ADDeviceEmulator::createScreenShoot(info);
        info.finish();
    });
}
Example #11
0
void openOneLevelScene(TestInfo info,
                       int collection_number,
                       int level_number,
                       int free_space_id)
{
    Collection* collection = RW::getCollectionByIndex(collection_number);

    //get level
    std::vector<Level*> levels = collection->getLevels();
    Level* level;
    for(unsigned int i=0; i<levels.size() ; ++i)
    {
        if(levels[i]->getLevelID() == level_number)
        {
            level = levels[i];
            break;
        }
    }

    // 'scene' is an autorelease object
    CCScene *scene = CCScene::create();

    // 'layer' is an autorelease object
    LevelScene *layer = LevelScene::create(level);

    BackgroundHolder::backgroundSwitchTo(scene,0,false);
    scene->addChild(layer);
    CCDirector::sharedDirector()->replaceScene(scene);
    layer->clickEquationSpace(free_space_id);

    ADDeviceEmulator::runLater(3.5f, [info]() {


        ADDeviceEmulator::createScreenShoot(info);
        info.finish();
    });
}