At 23.59 on the day that your class has agreed with the TA.
Any late hand-in must be agreed with your TA; failing to do so will allow the TA to reject evaluating your hand-in.
High
The learning goals of this week is frameworks aspects: analyzing your current HotStone system as a framework, as well as adding a graphical user interface for HotStone using the MiniDraw framework.
Ensure you have completely solved the Observer pattern exercise from Iteration 7. If not, you will never get the GUI running!
Carefully read FRS 37.7 "Frameworks" as it details the design you are required to implement, and the support code. You must carefully merge your own code with the provided code base 'hotstone-framework-start (ZIP)' code, the link is given below. See the hints below.
My slides from Week 9 on "HotStone GUI" provides further details and hints on the exercises.
Analyse whether your HotStone production code is a framework, using the framework characteristics.
... as detailed in the Iteration 8 report template below.
Download the hotstone-framework-start (ZIP) and merge it carefully into your HotStone project using the process I outline below in the Hints section. If you just extract the zip in your HotStone folder, you will overwrite some of your existing code!
This exercise is partially solved in the handed-out code base.
Complete the implementation of the provided but incomplete
HotStoneDrawingclass such that all state changes in a Game are observed and reflected in proper GUI updates.
Visual test class: ShowUpdate (package:
hotstone.domain2gui), gradle target:
update. Be sure to read the details in FRS
37.7.3!
It is advisable to integrate directly with a simple, real HotStone variant (for example AlphaStone) compared to using a Test Double/FakeObject. See the explanation in FRS 37.7.3.
This exercise is partially solved in the handed-out code base.
Complete the implementation of the MiniDraw Tools such that all graphical interactions are translated into the correct game mutator calls.
Visual test class: ShowTools (package:
hotstone.gui2domain), gradle target:
tools. Be sure to read the details in FRS
37.7.4!
Develop a complete GUI based SemiStone for system testing: Combine your developed SemiStone variant from the previous mandatory sprints with the solutions to this iteration's exercises.
Main class: HotSeatStone, gradle target:
hotseatstone. Executing this target should start a
full HotStone game in hotseat mode, allowing you to play with
a group member. Congratulations :).
Deliveries:
You have developed a lot of code, and now comes a new ZIP with even more code which poses the challenge of overwriting stuff. Be sure to make an 'integration' branch of your code and merge/extract the Zip file there, so you can "Do Over" in case it messes up.
I advice to unzip the supplied framework starter code in a distinct folder, and test that you can run the visual targes, like ShowText etc., correctly, before you merge. Take small steps, Keep Focus.
The process is that you can simply unzip or copy the contents of the Zip file onto your own code base (ensure that folders align up). This WILL overwrite some of your implementation files (probably 'StandardHotStoneGame.java' and 'TestAlphaStone.java'), so keep a backup ready or selectively merge from your main branch.
Next compile and test, and fix all issues until all is fixed. Run also the visual tests, like 'gradle update', etc.
When all your own test cases work; and the newly added programs run (ShowTools, etc.); then merge back into your main branch and push to the repository.
If you play HearthStone or have tried playing the PiStone
variant on the HotStone server, you
know that many card effects modify minions next to the
position where the card is dropped on the battle field. This
is the reason for the atIndex parameter of the
playCard(who, card, atIndex) method in
Game - it allows playing the card where the
benefit is greatest.
How does this translate to the MiniDraw UI? The provided code
has a class DropZone which can translate
graphical (x,y) coordinates to a proper index. You can use it
like the following example shows in your PlayCardTool:
@Override
public void mouseUp(MouseEvent e, int x, int y) {
// Note: no check if draggedActor is null, as it is guaranteed
// Invoke related facade method, if figure is a card
boolean isHittingField = y < GfxConstants.Y_LIMIT_OF_FIELD;
boolean moveCardBack = true;
if (isHittingField) {
Card associatedCard = draggedActor.getAssociatedCard();
int index = DropZone.computeFieldIndexOfDropPosition(editor.drawing(),
draggedActor.displayBox().getX(),
draggedActor.displayBox().getY());
....
In the code above, the index will be assigned the
proper value to pass on to the playCard() method.
Alternatively, just always drop the card at index 0.
Your submission is evaluated against the learning goals and adherence to the submission guidelines. The grading is explained in Grading Guidelines. The TAs will use the Iteration 8 Grade sheet to evaluate your submission.
| Learning Goal | Assessment parameters |
| Submission | Git repository contains an "iteration8" branch that is merged into main/master branch. Git repository is not public! Required artifacts (document, screencast) must all be present. |
| Framework Analysis and Usage | The framework analysis of HotStone is correct, uses the proper terminology (hotspots, frozen spots, inversion of control, etc.), and discusses Template Method (separation and unification variant discussed). MiniDraw's hotspots are used correctly to produce the GUI for HotStone. |
| MiniDraw Domain to GUI Integration |
The HotStoneDrawing implementation correctly
updates the GUI for all HotStone Game state changes
(demonstrated by the 'gradle update' target.)
|
| MiniDraw GUI to Domain Integration | The 'gradle tools' target correctly allows handling all the of the developed tools (PlayCardTool, MinionAttackTool, etc.), and all the tools are correctly working and implemented. |
| System Test | The system test ('hotseatstone' target) correctly executes a SemiStone game with full MiniDraw GUI integration. |