Commit b3313042 authored by Vitaliy Vashchenko's avatar Vitaliy Vashchenko

Merge branch 'V3.7' into feature-protocol-wall-position

parents c9508b67 cc32f3aa
......@@ -88,6 +88,7 @@ public class InTheDarknessGame extends AbstractTablexiaGame<List<MapWidget>> imp
public static final String PLAYER = "player";
public static final String EVENT_SHOW_ANIMATION_FINISHED = "show animation finished";
public static final String EVENT_SHOW_OTHER_FLOOR = "show other floor";
public enum GameLayer {
......@@ -191,7 +192,7 @@ public class InTheDarknessGame extends AbstractTablexiaGame<List<MapWidget>> imp
private final int START_TILE_OFFSET_X = 1;
private final int START_TILE_OFFSET_Y = 2;
private static final String BOOKMARK_FLOOR_TEXT_KEY = "floor";
public static final String BOOKMARK_FLOOR_TEXT_KEY = "floor";
private static final String SCORE0_TEXT_KEY = "score_0";
private static final String SCORE1_TEXT_KEY = "score_1";
private static final String SCORE2_TEXT_KEY = "score_2";
......@@ -684,6 +685,7 @@ public class InTheDarknessGame extends AbstractTablexiaGame<List<MapWidget>> imp
}
}
GameLayer.PLAYER_LAYER.getLayerEntity().setVisible(player.getActualFloor() == mapWidgetNumber);
triggerScenarioStepEvent(EVENT_SHOW_OTHER_FLOOR);
}
@Override
......
......@@ -135,6 +135,7 @@ public class MapWidget extends Group {
}
}
});
bookmarkButton.setName((floorNumber + 1) + " " + InTheDarknessGame.BOOKMARK_FLOOR_TEXT_KEY);
backgroundLayer.addActor(bookmarkButton);
}
......
......@@ -48,6 +48,7 @@ public class GameRulesHelper {
public static final float BONUS_MAX_LID_TIME = 2.5f;
public static final float BONUS_MIN_LID_TIME = 1.2f;
public static final int NUMBER_OF_ROUNDS = 12;
public static final int BONUS_NUMBER_OF_ROUNDS = 20;
public static final int[] ZERO_NUMBER_OF_SHADOWED = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
public static float getCurrentLidTime(NightWatchDifficulty nightWatchDifficulty, int currentRound){
......
......@@ -30,8 +30,10 @@ import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable;
import java.util.List;
import cz.nic.tablexia.game.games.safe.AbstractMechanics;
import cz.nic.tablexia.game.games.safe.SafeGame;
import cz.nic.tablexia.game.games.safe.assets.SafeAssets;
import cz.nic.tablexia.screen.AbstractTablexiaScreen;
/**
......@@ -80,6 +82,7 @@ public class BonusCableGroup extends Group {
@Override
public void clicked(InputEvent event, float x, float y) {
safeGame.setSelectedLight(lightImage, listOfLights, true);
AbstractTablexiaScreen.triggerScenarioStepEvent(AbstractMechanics.LIGHT_LIGHTED_UP);
}
});
lightImage.addListener(lightImage.getInputListener());
......
......@@ -23,6 +23,10 @@ TestGameShootingRangeHardNoneStar
TestGameShootingRangeHardOneStar
TestGameShootingRangeHardTwoStar
TestGameShootingRangeHardThreeStar
TestGameShootingRangeBonusNoneStar
TestGameShootingRangeBonusOneStar
TestGameShootingRangeBonusTwoStar
TestGameShootingRangeBonusThreeStar
TestGameRobberyEasyNoneStar
TestGameRobberyEasyOneStar
TestGameRobberyEasyTwoStar
......@@ -35,12 +39,18 @@ TestGameRobberyHardNoneStar
TestGameRobberyHardOneStar
TestGameRobberyHardTwoStar
TestGameRobberyHardThreeStar
TestGameRobberyBonusNoneStar
TestGameRobberyBonusOneStar
TestGameRobberyBonusTwoStars
TestGameRobberyBonusThreeStars
TestGameInTheDarknessEasy
TestGameInTheDarknessMedium
TestGameInTheDarknessHard
TestGameInTheDarknessBonus
TestGameInTheDarknessEasyScenario
TestGameInTheDarknessMediumScenario
TestGameInTheDarknessHardScenario
TestGameInTheDarknessBonusScenario
TestGameNightWatchEasyNoneStar
TestGameNightWatchEasyOneStar
TestGameNightWatchEasyTwoStar
......@@ -53,6 +63,10 @@ TestGameNightWatchHardNoneStar
TestGameNightWatchHardOneStar
TestGameNightWatchHardTwoStar
TestGameNightWatchHardThreeStar
TestGameNightWatchBonusNoneStar
TestGameNightWatchBonusOneStar
TestGameNightWatchBonusTwoStars
TestGameNightWatchBonusThreeStars
TestGamePursuitEasyNoneStar
TestGamePursuitEasyOneStar
TestGamePursuitEasyTwoStar
......@@ -65,6 +79,10 @@ TestGamePursuitHardNoneStar
TestGamePursuitHardOneStar
TestGamePursuitHardTwoStar
TestGamePursuitHardThreeStar
TestGamePursuitBonusNoneStar
TestGamePursuitBonusOneStar
TestGamePursuitBonusTwoStars
TestGamePursuitBonusThreeStars
TestGameCrimeSceneEasyNoneStar
TestGameCrimeSceneEasyOneStar
TestGameCrimeSceneEasyTwoStar
......@@ -77,6 +95,10 @@ TestGameCrimeSceneHardNoneStar
TestGameCrimeSceneHardOneStar
TestGameCrimeSceneHardTwoStar
TestGameCrimeSceneHardThreeStar
TestGameCrimeSceneBonusNoneStar
TestGameCrimeSceneBonusOneStar
TestGameCrimeSceneBonusTwoStar
TestGameCrimeSceneBonusThreeStar
TestGameKidnappingEasyNoneStar
TestGameKidnappingEasyOneStar
TestGameKidnappingEasyTwoStar
......@@ -89,6 +111,10 @@ TestGameKidnappingHardNoneStar
TestGameKidnappingHardOneStar
TestGameKidnappingHardTwoStar
TestGameKidnappingHardThreeStar
TestGameKidnappingBonusNoneStar
TestGameKidnappingBonusOneStar
TestGameKidnappingBonusTwoStars
TestGameKidnappingBonusThreeStars
TestGameRunesEasyNoneStar
TestGameRunesEasyOneStar
TestGameRunesEasyTwoStar
......@@ -101,6 +127,10 @@ TestGameRunesHardNoneStar
TestGameRunesHardOneStar
TestGameRunesHardTwoStar
TestGameRunesHardThreeStar
TestGameRunesBonusNoneStar
TestGameRunesBonusOneStar
TestGameRunesBonusTwoStars
TestGameRunesBonusThreeStars
TestGameProtocolEasyNoneStar <--This test could fail
TestGameProtocolEasyOneStar
TestGameProtocolEasyTwoStar
......@@ -125,6 +155,10 @@ TestGameSafeHardNoneStars
TestGameSafeHardOneStar
TestGameSafeHardTwoStars
TestGameSafeHardThreeStars
TestGameSafeBonusNoneStars
TestGameSafeBonusOneStars
TestGameSafeBonusTwoStars
TestGameSafeBonusThreeStars
TestStatisticsButtons
TestStatisticsRobbery
TestStatisticsCrimeScene
......
......@@ -99,6 +99,7 @@ public class TestGameCrimeScene extends AbstractTestGame {
clickAt(incGetSteps() + ". Click at medium difficulty button", GamePageGroup.DIFFICULTY_BUTTON_MEDIUM);
clickAt(incGetSteps() + ". Click at hard difficulty button", GamePageGroup.DIFFICULTY_BUTTON_HARD);
clickAt(incGetSteps() + ". Click at easy difficulty button", GamePageGroup.DIFFICULTY_BUTTON_EASY);
clickAt(incGetSteps() + ". Click at bonus difficulty button", GamePageGroup.DIFFICULTY_BUTTON_BONUS);
//setDifficulty
setGameDificulty();
......
/*
* Copyright (C) 2017 CZ.NIC, z.s.p.o. (http://www.nic.cz/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package cz.nic.tablexia.testing.games.in_the_darkness;
import cz.nic.tablexia.Tablexia;
import cz.nic.tablexia.game.AbstractTablexiaGame;
import cz.nic.tablexia.game.difficulty.GameDifficulty;
public class TestGameInTheDarknessBonus extends TestGameInTheDarkness {
public TestGameInTheDarknessBonus(Tablexia tablexia) {
super(tablexia);
expectedResult = AbstractTablexiaGame.GameResult.THREE_STAR;
difficulty = GameDifficulty.BONUS;
haveScenario = false;
}
}
/*
* Copyright (C) 2017 CZ.NIC, z.s.p.o. (http://www.nic.cz/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package cz.nic.tablexia.testing.games.in_the_darkness;
import java.util.Arrays;
import cz.nic.tablexia.Tablexia;
import cz.nic.tablexia.TablexiaSettings;
import cz.nic.tablexia.game.AbstractTablexiaGame;
import cz.nic.tablexia.game.difficulty.GameDifficulty;
import cz.nic.tablexia.game.games.in_the_darkness.action.InTheDarknessActionType;
public class TestGameInTheDarknessBonusScenario extends TestGameInTheDarkness {
public TestGameInTheDarknessBonusScenario(Tablexia tablexia) {
super(tablexia);
TablexiaSettings.GAMES_RANDOM_SEED = 1537270739566L;
difficulty = GameDifficulty.BONUS;
expectedResult = AbstractTablexiaGame.GameResult.THREE_STAR;
exceptedFail = 0;
haveScenario = true;
initSteps();
}
private void initSteps(){
scenarioSteps.put(0, Arrays.asList(new InTheDarknessActionType[]{
InTheDarknessActionType.GO,
InTheDarknessActionType.RIGHT,
InTheDarknessActionType.GO,
InTheDarknessActionType.LEFT,
InTheDarknessActionType.GO,
InTheDarknessActionType.RIGHT,
InTheDarknessActionType.GO,
InTheDarknessActionType.GO,
InTheDarknessActionType.LEFT,
InTheDarknessActionType.GO,
InTheDarknessActionType.RIGHT,
InTheDarknessActionType.GO,
InTheDarknessActionType.LEFT,
InTheDarknessActionType.GO,
InTheDarknessActionType.GO,
InTheDarknessActionType.GO,
InTheDarknessActionType.LEFT,
InTheDarknessActionType.GO,
InTheDarknessActionType.GO,
InTheDarknessActionType.KEY,
InTheDarknessActionType.LEFT,
InTheDarknessActionType.LEFT,
InTheDarknessActionType.GO,
InTheDarknessActionType.GO,
InTheDarknessActionType.RIGHT,
InTheDarknessActionType.GO,
InTheDarknessActionType.GO,
InTheDarknessActionType.GO,
InTheDarknessActionType.RIGHT,
InTheDarknessActionType.GO,
InTheDarknessActionType.GO,
InTheDarknessActionType.RIGHT,
InTheDarknessActionType.GO,
InTheDarknessActionType.LEFT,
InTheDarknessActionType.GO,
InTheDarknessActionType.RIGHT,
InTheDarknessActionType.GO,
InTheDarknessActionType.LEFT,
InTheDarknessActionType.GO,
InTheDarknessActionType.GO,
InTheDarknessActionType.RIGHT,
InTheDarknessActionType.GO,
InTheDarknessActionType.STAIRS,
InTheDarknessActionType.GO,
InTheDarknessActionType.LEFT,
InTheDarknessActionType.GO,
InTheDarknessActionType.LEFT,
InTheDarknessActionType.GO,
InTheDarknessActionType.RIGHT,
InTheDarknessActionType.GO,
InTheDarknessActionType.GO,
InTheDarknessActionType.GO,
InTheDarknessActionType.RIGHT,
InTheDarknessActionType.GO,
InTheDarknessActionType.GO,
InTheDarknessActionType.GO,
InTheDarknessActionType.GO,
InTheDarknessActionType.GO,
InTheDarknessActionType.RIGHT,
InTheDarknessActionType.GO,
InTheDarknessActionType.GO,
InTheDarknessActionType.GO,
InTheDarknessActionType.GO,
InTheDarknessActionType.RIGHT,
InTheDarknessActionType.GO,
}));
}
}
......@@ -89,6 +89,7 @@ public class TestGameKidnapping extends AbstractTestGame {
clickAt(incGetSteps() + ". Click at medium difficulty button", GamePageGroup.DIFFICULTY_BUTTON_MEDIUM);
clickAt(incGetSteps() + ". Click at hard difficulty button", GamePageGroup.DIFFICULTY_BUTTON_HARD);
clickAt(incGetSteps() + ". Click at easy difficulty button", GamePageGroup.DIFFICULTY_BUTTON_EASY);
clickAt(incGetSteps() + ". Click at bonus difficulty button", GamePageGroup.DIFFICULTY_BUTTON_BONUS);
//setDifficulty
setGameDificulty();
......
/*
* Copyright (C) 2017 CZ.NIC, z.s.p.o. (http://www.nic.cz/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package cz.nic.tablexia.testing.games.kidnapping;
import cz.nic.tablexia.Tablexia;
import cz.nic.tablexia.game.AbstractTablexiaGame;
import cz.nic.tablexia.game.difficulty.GameDifficulty;
public class TestGameKidnappingBonusNoneStar extends TestGameKidnapping {
public TestGameKidnappingBonusNoneStar(Tablexia tablexia) {
super(tablexia);
difficulty = GameDifficulty.BONUS;
expectedResult = AbstractTablexiaGame.GameResult.NO_STAR;
}
}
/*
* Copyright (C) 2017 CZ.NIC, z.s.p.o. (http://www.nic.cz/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package cz.nic.tablexia.testing.games.kidnapping;
import cz.nic.tablexia.Tablexia;
import cz.nic.tablexia.game.AbstractTablexiaGame;
import cz.nic.tablexia.game.difficulty.GameDifficulty;
public class TestGameKidnappingBonusOneStar extends TestGameKidnapping {
public TestGameKidnappingBonusOneStar(Tablexia tablexia) {
super(tablexia);
difficulty = GameDifficulty.BONUS;
expectedResult = AbstractTablexiaGame.GameResult.ONE_STAR;
}
}
/*
* Copyright (C) 2017 CZ.NIC, z.s.p.o. (http://www.nic.cz/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package cz.nic.tablexia.testing.games.kidnapping;
import cz.nic.tablexia.Tablexia;
import cz.nic.tablexia.game.AbstractTablexiaGame;
import cz.nic.tablexia.game.difficulty.GameDifficulty;
public class TestGameKidnappingBonusThreeStars extends TestGameKidnapping {
public TestGameKidnappingBonusThreeStars(Tablexia tablexia) {
super(tablexia);
difficulty = GameDifficulty.BONUS;
expectedResult = AbstractTablexiaGame.GameResult.THREE_STAR;
}
}
/*
* Copyright (C) 2017 CZ.NIC, z.s.p.o. (http://www.nic.cz/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package cz.nic.tablexia.testing.games.kidnapping;
import cz.nic.tablexia.Tablexia;
import cz.nic.tablexia.game.AbstractTablexiaGame;
import cz.nic.tablexia.game.difficulty.GameDifficulty;
public class TestGameKidnappingBonusTwoStars extends TestGameKidnapping {
public TestGameKidnappingBonusTwoStars(Tablexia tablexia) {
super(tablexia);
difficulty = GameDifficulty.BONUS;
expectedResult = AbstractTablexiaGame.GameResult.TWO_STAR;
}
}
......@@ -89,6 +89,7 @@ public class TestGameNightWatch extends AbstractTestGame {
clickAt(incGetSteps() + ". Click at medium difficulty button", GamePageGroup.DIFFICULTY_BUTTON_MEDIUM);
clickAt(incGetSteps() + ". Click at hard difficulty button", GamePageGroup.DIFFICULTY_BUTTON_HARD);
clickAt(incGetSteps() + ". Click at easy difficulty button", GamePageGroup.DIFFICULTY_BUTTON_EASY);
clickAt(incGetSteps() + ". Click at bonus difficulty button", GamePageGroup.DIFFICULTY_BUTTON_BONUS);
//setDifficulty
setGameDificulty();
......@@ -131,7 +132,9 @@ public class TestGameNightWatch extends AbstractTestGame {
List<Pair<Integer, Integer>> windowPositions = getWindowsPositionsByDif(difficulty);
for(int i=0;i< GameRulesHelper.NUMBER_OF_ROUNDS;i++){
int numberOfRounds = (difficulty == GameDifficulty.BONUS) ? GameRulesHelper.BONUS_NUMBER_OF_ROUNDS : GameRulesHelper.NUMBER_OF_ROUNDS;
for(int i=0;i< numberOfRounds;i++){
waitForEvent(incGetSteps() + ". Wait for new day event", NightWatchGame.EVENT_NEW_DAY +i);
//play round
Solution solution = NightWatchGame.lastSolution;
......@@ -178,7 +181,7 @@ public class TestGameNightWatch extends AbstractTestGame {
break;
}
if(i != GameRulesHelper.NUMBER_OF_ROUNDS-1) {
if(i != numberOfRounds-1) {
waitForEvent(incGetSteps() + ". Wait for evaluate round event",NightWatchGame.EVENT_EVALUATE_ROUND+i);
waitForEvent(incGetSteps() + ". Wait for new night event", NightWatchGame.EVENT_NEW_NIGHT + i);
}
......@@ -213,12 +216,19 @@ public class TestGameNightWatch extends AbstractTestGame {
}
private boolean doMistake(){
if(difficulty == GameDifficulty.BONUS){
if(expectedResult == AbstractTablexiaGame.GameResult.TWO_STAR && playedRound >= NightWatchScoreResolver_V3_4.BONUS_SCORE_THREE_STARS_V3_4 -NightWatchGame.MAX_GAME_ERRORS -1){ return true;}
else if(expectedResult == AbstractTablexiaGame.GameResult.ONE_STAR && playedRound >= NightWatchScoreResolver_V3_4.BONUS_SCORE_TWO_STARS_V3_4 -NightWatchGame.MAX_GAME_ERRORS-1){ return true;}
else if(expectedResult == AbstractTablexiaGame.GameResult.NO_STAR && playedRound >= NightWatchScoreResolver_V3_4.BONUS_SCORE_ONE_STAR_V3_4-NightWatchGame.MAX_GAME_ERRORS-1) { return true;}
if(expectedResult == AbstractTablexiaGame.GameResult.TWO_STAR && playedRound >= NightWatchScoreResolver_V3_4.SCORE_THREE_STARS_V3_4 -NightWatchGame.MAX_GAME_ERRORS -1){ return true;}
else if(expectedResult == AbstractTablexiaGame.GameResult.ONE_STAR && playedRound >= NightWatchScoreResolver_V3_4.SCORE_TWO_STARS_V3_4 -NightWatchGame.MAX_GAME_ERRORS-1){ return true;}
else if(expectedResult == AbstractTablexiaGame.GameResult.NO_STAR && playedRound >= NightWatchScoreResolver_V3_4.SCORE_ONE_STAR_V3_4-NightWatchGame.MAX_GAME_ERRORS-1) { return true;}
return false;
} else {
if(expectedResult == AbstractTablexiaGame.GameResult.TWO_STAR && playedRound >= NightWatchScoreResolver_V3_4.SCORE_THREE_STARS_V3_4 -NightWatchGame.MAX_GAME_ERRORS -1){ return true;}
else if(expectedResult == AbstractTablexiaGame.GameResult.ONE_STAR && playedRound >= NightWatchScoreResolver_V3_4.SCORE_TWO_STARS_V3_4 -NightWatchGame.MAX_GAME_ERRORS-1){ return true;}
else if(expectedResult == AbstractTablexiaGame.GameResult.NO_STAR && playedRound >= NightWatchScoreResolver_V3_4.SCORE_ONE_STAR_V3_4-NightWatchGame.MAX_GAME_ERRORS-1) { return true;}
return false;
return false;
}
}
private void clickWindowsByIndex(int index, Stage stage, List<Pair<Integer, Integer>> windowPositions){
......@@ -238,7 +248,6 @@ public class TestGameNightWatch extends AbstractTestGame {
}
if(isSelectedWindowVisible(index,stage)){
logOK();
waitForEvent(incGetSteps() + ". Wait for window selected event",NightWatchGame.EVENT_WINDOW_SELECTED+index);
}else{
writeToLogFile("Window not selected [TRY NEXT]\n");
......@@ -295,6 +304,8 @@ public class TestGameNightWatch extends AbstractTestGame {
private List<Pair<Integer, Integer>> getWindowsPositionsByDif(GameDifficulty difficulty){
switch (difficulty){
case BONUS:
return TextureHelper.testThirtyTwoWindowsPositions;
case HARD:
return TextureHelper.testThirtyTwoWindowsPositions;
case MEDIUM:
......@@ -307,8 +318,9 @@ public class TestGameNightWatch extends AbstractTestGame {
@Override
protected void checkVictoryTable(int daoScore, Table table) {
if(!checkScoreInTable(table,Integer.toString(daoScore) + " / " + GameRulesHelper.NUMBER_OF_ROUNDS)){
logError("Not found label in " + AbstractTablexiaGame.RESULT_TABLE+ " with correct dao score: " + Integer.toString(daoScore) + " / " + GameRulesHelper.NUMBER_OF_ROUNDS);
int numberOfRounds = (difficulty == GameDifficulty.BONUS) ? GameRulesHelper.BONUS_NUMBER_OF_ROUNDS : GameRulesHelper.NUMBER_OF_ROUNDS;
if(!checkScoreInTable(table,Integer.toString(daoScore) + " / " + numberOfRounds)){
logError("Not found label in " + AbstractTablexiaGame.RESULT_TABLE+ " with correct dao score: " + Integer.toString(daoScore) + " / " + numberOfRounds);
stopTheTest();
}
}
......@@ -324,10 +336,17 @@ public class TestGameNightWatch extends AbstractTestGame {
@Override
protected int getCubsCount() {
if (playedRound > NightWatchScoreResolver_V3_4.SCORE_THREE_STARS_V3_4) return 3;
else if (playedRound > NightWatchScoreResolver_V3_4.SCORE_TWO_STARS_V3_4) return 2;
else if (playedRound > NightWatchScoreResolver_V3_4.SCORE_ONE_STAR_V3_4) return 1;
return 0;
if(difficulty == GameDifficulty.BONUS){
if (playedRound > NightWatchScoreResolver_V3_4.BONUS_SCORE_THREE_STARS_V3_4) return 3;
else if (playedRound > NightWatchScoreResolver_V3_4.BONUS_SCORE_TWO_STARS_V3_4) return 2;
else if (playedRound > NightWatchScoreResolver_V3_4.BONUS_SCORE_ONE_STAR_V3_4) return 1;
return 0;
} else {
if (playedRound > NightWatchScoreResolver_V3_4.SCORE_THREE_STARS_V3_4) return 3;
else if (playedRound > NightWatchScoreResolver_V3_4.SCORE_TWO_STARS_V3_4) return 2;
else if (playedRound > NightWatchScoreResolver_V3_4.SCORE_ONE_STAR_V3_4) return 1;
return 0;
}
}
@Override
......
/*
* Copyright (C) 2017 CZ.NIC, z.s.p.o. (http://www.nic.cz/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package cz.nic.tablexia.testing.games.night_watch;
import cz.nic.tablexia.Tablexia;
import cz.nic.tablexia.game.AbstractTablexiaGame;
import cz.nic.tablexia.game.difficulty.GameDifficulty;
public class TestGameNightWatchBonusNoneStar extends TestGameNightWatch {
public TestGameNightWatchBonusNoneStar(Tablexia tablexia) {
super(tablexia);
difficulty = GameDifficulty.BONUS;
expectedResult = AbstractTablexiaGame.GameResult.NO_STAR;
}
}
/*
* Copyright (C) 2017 CZ.NIC, z.s.p.o. (http://www.nic.cz/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package cz.nic.tablexia.testing.games.night_watch;
import cz.nic.tablexia.Tablexia;
import cz.nic.tablexia.game.AbstractTablexiaGame;
import cz.nic.tablexia.game.difficulty.GameDifficulty;
public class TestGameNightWatchBonusOneStar extends TestGameNightWatch {
public TestGameNightWatchBonusOneStar(Tablexia tablexia) {
super(tablexia);
difficulty = GameDifficulty.BONUS;
expectedResult = AbstractTablexiaGame.GameResult.ONE_STAR;
}
}
/*
* Copyright (C) 2017 CZ.NIC, z.s.p.o. (http://www.nic.cz/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package cz.nic.tablexia.testing.games.night_watch;
import cz.nic.tablexia.Tablexia;
import cz.nic.tablexia.game.AbstractTablexiaGame;
import cz.nic.tablexia.game.difficulty.GameDifficulty;
public class TestGameNightWatchBonusThreeStars extends TestGameNightWatch {
public TestGameNightWatchBonusThreeStars(Tablexia tablexia) {
super(tablexia);
difficulty = GameDifficulty.BONUS;
expectedResult = AbstractTablexiaGame.GameResult.THREE_STAR;
}
}
/*
* Copyright (C) 2017 CZ.NIC, z.s.p.o. (http://www.nic.cz/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package cz.nic.tablexia.testing.games.night_watch;
import cz.nic.tablexia.Tablexia;
import cz.nic.tablexia.game.AbstractTablexiaGame;
import cz.nic.tablexia.game.difficulty.GameDifficulty;