1. 04 Jun, 2021 1 commit
  2. 24 Jan, 2021 6 commits
    • Julian Helfferich's avatar
      Do not call setupGui() in KBlocksWin constructor · 17b25472
      Julian Helfferich authored
      This function makes it more difficult to build unit tests for
      KBlocksWin. A better way is to make this a public member and call it
      explicitely after the KBlocksWin object has been created.
      17b25472
    • Julian Helfferich's avatar
      Do not create KBlocksGraphics and KBlocksSound objects in KBlocksScene · 13fc0e56
      Julian Helfferich authored
      Complex objects being created in constructors is always a big headache
      for unit tests, particularly in C++, because constructor calls can't be
      avoided and neither can the work be delegated to a virtual member
      function.
      
      Instead of creating the objects, KBlocksScene now takes them as input
      parameters.
      
      This reduces the number of warnings in the UnitTest-KBlocksWin test
      suite to one.
      13fc0e56
    • Julian Helfferich's avatar
      Create new method in game logic: hasSingleGames() · 288c346a
      Julian Helfferich authored
      Using this new functionality, the KBlocksWin::stopGame() method can be
      improved and made more readable. The check if single games were created
      are now made explicit.
      288c346a
    • Julian Helfferich's avatar
      Fix the test and fix the crash · 1d2ae0cc
      Julian Helfferich authored
      To fix the issue, I introduced a test whether the game logic object has
      created single games (by trying to access one). Only if the game logic
      object has single games, stop game and delete single games is called.
      
      I have also confirmed by manual testing that the game no longer crashes
      when (re)starting a game after the first one.
      
      The test is not as unit-test-y as I would like: Several QWARN are
      issued. Furthermore, there is another option to improve usability:
      
      The last piece is also placed ontop of an existing piece, triggering a
      game over. However, this final piece is still invisible.
      1d2ae0cc
    • Julian Helfferich's avatar
      Replace KBlocksGameLogic with GameLogicInterface in KBlocksWin · e426bdca
      Julian Helfferich authored
      To be able to sense the actions performed on the game logic element, I
      want to be able to replace the GameLogic with a Mock object.
      e426bdca
    • Julian Helfferich's avatar
      Use SceneInterface also in KBlocksWin · 283a4c99
      Julian Helfferich authored
      The goal is still to be able to use a MockScene in KBlocksWin that can
      be used in unit testing.
      283a4c99
  3. 15 Jan, 2021 1 commit
    • Julian Helfferich's avatar
      Move source files to src/ directory · 140ffb31
      Julian Helfferich authored
      The main directory has become quite cluttered. It contained 24 non-source-code
      files together with 74 .h and .cpp files. All source code files have been
      moved to a new directory named 'src'.
      140ffb31
  4. 31 Jul, 2020 1 commit
  5. 27 Jun, 2019 1 commit
  6. 08 Jun, 2019 1 commit
  7. 27 Jul, 2017 1 commit
    • Julian Helfferich's avatar
      Fix incorrect resize before game is started · 6ee61601
      Julian Helfferich authored and Albert Astals Cid's avatar Albert Astals Cid committed
      When the game window is resized before a game is started, the game scene is not correctly rescaled. When starting the game it might be too small (it seems never to be too large).
      
      This commit fixes the bug by triggering a fitInView() call of the gameView. The same function is triggered by a resize event.
      
      BUGS: 380464
      REVIEW: 130167
      6ee61601
  8. 13 Mar, 2017 1 commit
  9. 29 Mar, 2016 1 commit
  10. 28 Mar, 2016 1 commit
    • Julian Helfferich's avatar
      Stop playing sounds when game is paused · 06831e32
      Julian Helfferich authored
      KBlocksWin now tells the AIPlayer and the KeyboardPlayer when the game
      is paused and resumed. The pauseGame() functions are already available
      for the two classes, but they have not been used yet.
      
      REVIEW: 127489
      06831e32
  11. 22 Mar, 2016 1 commit
    • Julian Helfferich's avatar
      Activate sounds in KBlocks · d8d4f559
      Julian Helfferich authored
      Activate sounds making use of the new KgSound system. Sounds are played
      only for the human (keyboard) player. Keyboard input is connected to
      the game scene which owns an instance of KBlocksSound playing the
      sounds.
      
      BUG: 319372
      FIXED-IN: KDE Applications 16.04
      
      REVIEW: 127370
      d8d4f559
  12. 28 Feb, 2016 1 commit
    • Julian Helfferich's avatar
      Fix unplayable game when changing difficulty · 145820a7
      Julian Helfferich authored
      Previously, changing the difficulty before the first game was started
      by selecting "Single Game" or "Human vs. AI" started an unplayable
      game.
      
      Now, levelChanged() calls singleGame() or pveStepGame() instead of
      startGame(). These functions are also called when selecting "Single
      Game" or "Human vs. AI", respectively, and correctly connect keyboard
      events to the game.
      
      BUG: 339038
      REVIEW: 127171
      145820a7
  13. 23 Feb, 2016 1 commit
    • Julian Helfferich's avatar
      Disable pause button when game stops · a08ba94a
      Julian Helfferich authored
      Previously, the pause button remained enabled even when no game was
      running. Only when it was pressed, KBlocks checked if a game was running
      and disabled the button if not.
      
      Now, a signal is emitted when the game stops and the pause button is
      disabled right away.
      
      REVIEW: 126788
      a08ba94a
  14. 10 Jan, 2016 1 commit
  15. 17 Dec, 2015 1 commit
    • Julian Helfferich's avatar
      Deactivate pause button when no game is running · 6879ab00
      Julian Helfferich authored
      Before, the pause button was always activated even when no game was
      running. This lead to undesired behavior, e.g. making it necessary to
      press the pause button twice to pause the game.
      
      With this fix, the pause button is deactivated on startup. The button
      gets activated when a game is started and when the button is pressed, it
      checks whether there is a running game.
      
      BUG: 264088
      REVIEW: 126200
      6879ab00
  16. 28 Oct, 2015 1 commit
  17. 07 Feb, 2015 1 commit
  18. 29 Jan, 2015 1 commit
  19. 18 Jan, 2015 1 commit
  20. 14 Dec, 2014 1 commit
  21. 09 Dec, 2014 1 commit
  22. 04 Dec, 2014 1 commit
  23. 13 Sep, 2014 2 commits
  24. 27 Apr, 2014 1 commit
  25. 01 May, 2012 1 commit
  26. 07 Mar, 2012 1 commit
  27. 31 Jul, 2011 1 commit
  28. 30 May, 2011 1 commit
  29. 16 Mar, 2011 1 commit
  30. 25 Sep, 2010 1 commit
  31. 13 Apr, 2010 1 commit
  32. 13 Jan, 2010 1 commit
  33. 02 Dec, 2009 1 commit
  34. 30 Nov, 2009 1 commit