SWEA 2025 Weekplan 9

The learning goals for Week 44 are:

Mon: MiniDraw - an example framework. Wed: HotStone support code for MiniDraw. Framework Theory.

Literature:

Slides:

Notes for this weekplan:

Lectures Monday start at 9.15. The focus is on MiniDraw, our example of a Framework (W9-1).

Lab classes should work on Mandatory iteration 7.

The Wednesday lecture will cover the HotStone mandatory GUI exercise: Presentations W9-2 and W9-3. W9-2 provides essential clues in solving the mandatory, while W9-3 is actually optional material, mostly about my own architectural design decisions about how the handed-out "glue code between Game and MiniDraw" was designed and developed.

The W9-4 Framework presentation is one of those 'terminology heavy' presentations that are, well, boring to present and boring to listen to in the auditorium. Therefore, it (and the Composite pattern presentation) is available as screencast and will not be repeated live. Still, the theoretical contents on Template Method in Separation/Unification formulation, frozen- and hotspots are central concepts in one of the exam questions. (The slides about WarpTalk is from last year's HCI project, so just skip that.)

The W9-2 screencast is available iff you want/need to dig into the HotStone GUI code earlier than Wednesday. But I will go over them Wednesday...

Kata

Spend the first 15-20 minutes of the TØ/Lab class in plenum discussing...

... the HotStone observer protocol

The learning goal of this kata is to explore the new role that Game must support: to be Observable; and thus help you in solving the 'Observer' exercise below.

Study FRS § 37.6 carefully, as it outlines the protocol to use in our HotStone system. You will find the full GameObserver interface in: GameObserver.java, and the Observable interface in Observable.java.

Consider the following scenarios during a HotStone game, and sketch the expected call sequence of onX() that will arrive at the Observer of the game (no coding, just draw a sequence diagram or list the onX() calls as shown below):

  1. Findus uses the power of ThaiChef (power: reduce opponent Hero by 2 health) and has enough mana to do so. (This is the FRS §37.6 example)
    Solution:
    onUsePower(FINDUS) - due to the mutator being called
      onHeroUpdate(FINDUS) - due to hero spending mana
      onHeroUpdate(PEDDERSEN) - due to opponent health reduced
                
  2. Findus tries to use the power of ThaiChef but only has one mana.
  3. Peddersen successfully plays "Spring Rolls" from EtaStone (Destory a random opponent minion) which kills Findus' "Brown Rice" minion.
  4. Peddersen successfully plays "Noodle Soup" from EtaStone (Draw a card from deck).
  5. Peddersen ends his turn [Consider both that Findus' deck is exhausted or it is not].
  6. Findus successfully plays "Holy Nova" from "FutureStone" (Deal 2 damage to all enemy minions. Restore 2 Health to all friendly characters.). Findus has Brown Rice and Poke Bowl fielded, while Peddersen has Spring Rolls (health 4) and French Fries (health 1) fielded.

Furthermore, discuss the distinction between 'Direct' and 'Indirect/derived' events in the GameObserver interface. What reasons can there be for including the 'Direct' onX() calls?

Optional Exercises:

These are optional exercises. Be sure to solve the mandatory project first, and only if you have a lot of spare time, try having a look at the exercises below.

28.2 29.1 30.4

Rehearse a framework exam situation. Spend 20-25 minutes to prepare a 10 minute oral presentation of an exercise in the example exam question set: demo-question-2025.pdf.

Next, do a 10 minute presentation at the whiteboard in front of your team.

The team provides constructive feedback on the presentation: Is your presentation clear and understandable, do you discuss the concepts and terms correctly, is you Java example code correct, etc. Swap and ensure all in the team gets a chance to rehearse the situation.