Commit 09391945 authored by Aneta Steimarova's avatar Aneta Steimarova

#929 Fixing problem with Protocol game - moving to furniture

parent d9f889c4
TestGameCrimeSceneEasyNoneStar
TestGameCrimeSceneEasyOneStar
TestGameCrimeSceneEasyTwoStar
TestGameCrimeSceneEasyThreeStar
TestGameCrimeSceneMediumNoneStar
TestGameCrimeSceneMediumOneStar
TestGameCrimeSceneMediumTwoStar
TestGameCrimeSceneMediumThreeStar
TestGameCrimeSceneHardNoneStar
TestGameCrimeSceneHardOneStar
TestGameCrimeSceneHardTwoStar
TestGameCrimeSceneHardThreeStar
TestGameProtocolHardOneStar
TestGameProtocolHardTwoStar
TestGameProtocolHardThreeStar
TestGameProtocolHardOneStar
TestGameProtocolHardTwoStar
TestGameProtocolHardThreeStar
TestGameProtocolHardOneStar
TestGameProtocolHardTwoStar
TestGameProtocolHardThreeStar
TestGameProtocolHardOneStar
TestGameProtocolHardTwoStar
TestGameProtocolHardThreeStar
TestGameProtocolHardOneStar
TestGameProtocolHardTwoStar
TestGameProtocolHardThreeStar
TestGameProtocolHardOneStar
TestGameProtocolHardTwoStar
TestGameProtocolHardThreeStar
TestGameProtocolHardOneStar
TestGameProtocolHardTwoStar
TestGameProtocolHardThreeStar
TestGameProtocolHardOneStar
TestGameProtocolHardTwoStar
TestGameProtocolHardThreeStar
TestGameProtocolHardOneStar
TestGameProtocolHardTwoStar
TestGameProtocolHardThreeStar
TestGameProtocolHardOneStar
TestGameProtocolHardTwoStar
TestGameProtocolHardThreeStar
TestGameProtocolHardOneStar
TestGameProtocolHardTwoStar
TestGameProtocolHardThreeStar
TestGameProtocolHardOneStar
TestGameProtocolHardTwoStar
TestGameProtocolHardThreeStar
......@@ -293,7 +293,7 @@ public class TestGameProtocol extends AbstractTestGame {
float yPosition = furniturePosition.y + (furniture.getFurnitureImage().getHeight() * fixRatio[1])/* - gameObject.getCenterPosition().y*/;
logInfo(incGetSteps() + ". Move object [" + gameObject.getType() + "] on the furniture [" + furnitureType + "]");
moveGameObjectToPosition(gameObject, xPosition, yPosition);
moveGameObjectToFurniturePosition(gameObject, xPosition, yPosition);
}
private void moveObjectToWall(GameObject gameObject, WallType wallType) {
......@@ -481,6 +481,35 @@ public class TestGameProtocol extends AbstractTestGame {
return angle;
}
private void moveGameObjectToFurniturePosition(GameObject object, float xFinish, float yFinish) {
final int firstFingerPointer = 0;
final float duration = 0.5f;
Vector2 objectPosition = getActorPosition(object, ActorPosition.BOTTOM_LEFT);
float xPosition = objectPosition.x + ProtocolGame.CARD_SMALL_SIZE / 2 - 5;
float yPosition = objectPosition.y + ProtocolGame.CARD_SMALL_SIZE / 2 - 5;
Stage stage = object.getStage();
clickAt((int)xFinish, (int)yFinish, stage);
takeScreenShotBlocking();
boolean result = touchDown(xPosition, yPosition, 0, Input.Buttons.LEFT, stage);
result &= dragOverTime((int) xPosition, (int) yPosition, (int) xFinish, (int) yFinish, firstFingerPointer, duration, 30, stage);
takeScreenShotBlocking();
result &= touchUp(xFinish, yFinish, 0, Input.Buttons.LEFT, stage);
takeScreenShotBlocking();
if (!result) {
logError("Cannot move gameObject " + object.getType());
stopTheTest();
}
logOK();
waitForEvent(incGetSteps() + ". Wait for drop event", ProtocolGame.DROP_EVENT + object.getType());
returnToFirstCard();
}
private void moveGameObjectToPosition(GameObject object, float xFinish, float yFinish) {
final int firstFingerPointer = 0;
final float duration = 0.5f;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment