diff options
author | Jannis Harder <harder@informatik.uni-luebeck.de> | 2011-05-31 19:04:22 +0200 |
---|---|---|
committer | Jannis Harder <harder@informatik.uni-luebeck.de> | 2011-05-31 19:04:22 +0200 |
commit | 807a9ac692dcf5f57551c0b8496def676cd88465 (patch) | |
tree | be42360d17b11f0706f7e9ffbf488da9cc430611 /uml | |
parent | bc04d21afb9534e3f0aed53045ecc3a30a37bf81 (diff) | |
download | JRummikub-807a9ac692dcf5f57551c0b8496def676cd88465.tar JRummikub-807a9ac692dcf5f57551c0b8496def676cd88465.zip |
Added new sequence diagrams
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@355 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'uml')
-rw-r--r-- | uml/sequence/img/sequence_01.png | bin | 0 -> 47871 bytes | |||
-rw-r--r-- | uml/sequence/img/sequence_02.png | bin | 0 -> 37235 bytes | |||
-rw-r--r-- | uml/sequence/img/sequence_03.png | bin | 0 -> 51303 bytes | |||
-rw-r--r-- | uml/sequence/img/sequence_04.png | bin | 0 -> 51773 bytes | |||
-rw-r--r-- | uml/sequence/img/sequence_05.png | bin | 0 -> 45798 bytes | |||
-rw-r--r-- | uml/sequence/img/sequence_06.png | bin | 0 -> 49943 bytes | |||
-rw-r--r-- | uml/sequence/img/sequence_07.png | bin | 0 -> 49331 bytes | |||
-rw-r--r-- | uml/sequence/img/sequence_08.png | bin | 0 -> 36704 bytes | |||
-rw-r--r-- | uml/sequence/img/sequence_09.png | bin | 0 -> 51833 bytes | |||
-rw-r--r-- | uml/sequence/img/sequence_10.png | bin | 0 -> 45932 bytes | |||
-rw-r--r-- | uml/sequence/img/sequence_11.png | bin | 0 -> 31476 bytes | |||
-rw-r--r-- | uml/sequence/img/sequence_complete.png | bin | 0 -> 777925 bytes | |||
-rw-r--r-- | uml/sequence/sequence.plant | 2031 |
13 files changed, 2031 insertions, 0 deletions
diff --git a/uml/sequence/img/sequence_01.png b/uml/sequence/img/sequence_01.png Binary files differnew file mode 100644 index 0000000..76e4e26 --- /dev/null +++ b/uml/sequence/img/sequence_01.png diff --git a/uml/sequence/img/sequence_02.png b/uml/sequence/img/sequence_02.png Binary files differnew file mode 100644 index 0000000..61bd123 --- /dev/null +++ b/uml/sequence/img/sequence_02.png diff --git a/uml/sequence/img/sequence_03.png b/uml/sequence/img/sequence_03.png Binary files differnew file mode 100644 index 0000000..1f753c4 --- /dev/null +++ b/uml/sequence/img/sequence_03.png diff --git a/uml/sequence/img/sequence_04.png b/uml/sequence/img/sequence_04.png Binary files differnew file mode 100644 index 0000000..2985968 --- /dev/null +++ b/uml/sequence/img/sequence_04.png diff --git a/uml/sequence/img/sequence_05.png b/uml/sequence/img/sequence_05.png Binary files differnew file mode 100644 index 0000000..1e19df5 --- /dev/null +++ b/uml/sequence/img/sequence_05.png diff --git a/uml/sequence/img/sequence_06.png b/uml/sequence/img/sequence_06.png Binary files differnew file mode 100644 index 0000000..cf434db --- /dev/null +++ b/uml/sequence/img/sequence_06.png diff --git a/uml/sequence/img/sequence_07.png b/uml/sequence/img/sequence_07.png Binary files differnew file mode 100644 index 0000000..638f852 --- /dev/null +++ b/uml/sequence/img/sequence_07.png diff --git a/uml/sequence/img/sequence_08.png b/uml/sequence/img/sequence_08.png Binary files differnew file mode 100644 index 0000000..2590f84 --- /dev/null +++ b/uml/sequence/img/sequence_08.png diff --git a/uml/sequence/img/sequence_09.png b/uml/sequence/img/sequence_09.png Binary files differnew file mode 100644 index 0000000..bb7eac0 --- /dev/null +++ b/uml/sequence/img/sequence_09.png diff --git a/uml/sequence/img/sequence_10.png b/uml/sequence/img/sequence_10.png Binary files differnew file mode 100644 index 0000000..3e09bb7 --- /dev/null +++ b/uml/sequence/img/sequence_10.png diff --git a/uml/sequence/img/sequence_11.png b/uml/sequence/img/sequence_11.png Binary files differnew file mode 100644 index 0000000..c5108d2 --- /dev/null +++ b/uml/sequence/img/sequence_11.png diff --git a/uml/sequence/img/sequence_complete.png b/uml/sequence/img/sequence_complete.png Binary files differnew file mode 100644 index 0000000..bb6c656 --- /dev/null +++ b/uml/sequence/img/sequence_complete.png diff --git a/uml/sequence/sequence.plant b/uml/sequence/sequence.plant new file mode 100644 index 0000000..34be5aa --- /dev/null +++ b/uml/sequence/sequence.plant @@ -0,0 +1,2031 @@ +@startuml img/sequence_complete.png +hide footbox + +participant view as "view : View" +participant handPanel as "handPanel : HandPanel" +participant playerPanel as "playerPanel : PlayerPanel" +participant tablePanel as "tablePanel : TablePanel" +participant roundControl as "roundControl : RoundControl" +participant ITurnControlFactory +participant humanTurnControlFactory as "humanTurnControlFactory : ITurnControlFactory" +participant turnControl as "turnControl : HumanTurnControl" +participant humanTurnControlFactory2 as "humanTurnControlFactory : ITurnControlFactory" +participant turnControl2 as "turnControl : HumanTurnControl" +participant humanTurnControlFactory3 as "humanTurnControlFactory : ITurnControlFactory" +participant turnControl3 as "turnControl : HumanTurnControl" +participant humanTurnControlFactory4 as "humanTurnControlFactory : ITurnControlFactory" +participant turnControl4 as "turnControl : HumanTurnControl" +participant roundState as "roundState : RoundState" +participant table as "table : Table" +participant clonedTable as "clonedTable : Table" +participant clonedTable2 as "clonedTable2 : Table" +participant clonedTable3 as "clonedTable3 : Table" +participant clonedTable4 as "clonedTable4 : Table" +participant playerA as "playerA : Player" +participant playerASettings as "playerASettings : PlayerSettings" +participant playerAHand as "playerAHand : Hand" +participant playerB as "playerB : Player" +participant playerBSettings as "playerBSettings : PlayerSettings" +participant playerBHand as "playerBHand : Hand" +participant gameHeap as "gameHeap : StoneHeap" + +== Initialize player B's turn == + +[-> view +activate view +view -> roundControl : startTurn() : void +activate roundControl + +roundControl -> roundState : getActivePlayer() : Player +activate roundState +roundControl <<-- roundState : playerB +deactivate roundState + +roundControl -> playerB : getPlayerSettings() : PlayerSettings +activate playerB +roundControl <<-- playerB : playerBSettings +deactivate playerB + +roundControl -> playerBSettings : getTurnControlType() : ITurnControlFactory.Type +activate playerBSettings +roundControl <<-- playerBSettings : HUMAN +deactivate playerBSettings + + +roundControl -> ITurnControlFactory : getFactory(HUMAN) : ITurnControlFactory +activate ITurnControlFactory + +create humanTurnControlFactory +ITurnControlFactory -> humanTurnControlFactory : <<create>> +activate humanTurnControlFactory +humanTurnControlFactory -->> ITurnControlFactory +deactivate humanTurnControlFactory + +ITurnControlFactory -->> roundControl : humanTurnControlFactory : ITurnControlFactory +deactivate ITurnControlFactory + +roundControl -> humanTurnControlFactory : create() : ITurnControl +activate humanTurnControlFactory +create turnControl +humanTurnControlFactory -> turnControl : <<create>> +activate turnControl +turnControl -->> humanTurnControlFactory +deactivate turnControl + +humanTurnControlFactory -->> roundControl : turnControl +deactivate humanTurnControlFactory + +' roundControl -> table : clone() +' activate table +' create clonedTable +' table -> clonedTable : <<create>> +' activate clonedTable +' table <<-- clonedTable +' deactivate clonedTable +' roundControl <<-- table : clonedTable +' deactivate table + +roundControl -> turnControl : setup(player, clonedTable, view, false, false) : void +activate turnControl +turnControl -->> roundControl +deactivate turnControl + +roundControl -> turnControl : startTurn() : void +activate turnControl + +turnControl -> handPanel : setStones(hand.clone()) : void +activate handPanel +handPanel -->> turnControl +deactivate handPanel + +turnControl -> view : setBottomPanel(HUMAN_HAND_PANEL) : void +activate view +view -->> turnControl +deactivate view + + +turnControl -->> roundControl +deactivate turnControl + +view <<-- roundControl +deactivate roundControl + +[<<-- view +deactivate view + +== Player B appends stone to set == + +[-> handPanel +activate handPanel + +handPanel -> turnControl : stoneClick(stone1, false) : void +activate turnControl + +turnControl -> view : setSelectedStones({stone1}) : void +activate view +turnControl <<- view +deactivate view + +handPanel <<-- turnControl +deactivate turnControl + +[<<-- handPanel +deactivate handPanel + +[-> tablePanel +activate tablePanel + +tablePanel -> turnControl : connectorClick(stoneSet1, true) : void +activate turnControl + +' TODO self calls? + +turnControl -> turnControl : pickUpSelectedStones() : void +activate turnControl + +turnControl -> playerBHand : pickUp(stone1) : boolean +activate playerBHand +turnControl <<-- playerBHand : true +deactivate playerBHand + +turnControl <<-- turnControl +deactivate turnControl + + +turnControl -> clonedTable : getPosition(stoneSet1) : Position +activate clonedTable +turnControl <<-- clonedTable : position +deactivate clonedTable + +turnControl -> clonedTable : pickUp(stoneSet1) : boolean +activate clonedTable +turnControl <<-- clonedTable : true +deactivate clonedTable + +turnControl -> clonedTable : drop(joinedStoneSet, newPosition) : void +activate clonedTable +turnControl <<-- clonedTable +deactivate clonedTable + +turnControl -> tablePanel : setStoneSets(clonedTable) : void +activate tablePanel +turnControl <<- tablePanel +deactivate tablePanel + +turnControl -> handPanel : setStones(playerBHand) : void +activate handPanel +turnControl <<- handPanel +deactivate handPanel + +turnControl -> view : setSelectedStones({}) : void +activate view +turnControl <<- view +deactivate view + + +tablePanel <<-- turnControl +deactivate turnControl + +[<<-- tablePanel +deactivate tablePanel + +== End of player B's turn == + +[-> playerPanel +activate playerPanel + +playerPanel -> turnControl : endOfTurn() : void +activate turnControl + +turnControl -> roundControl : endOfTurn() : void +activate roundControl + +roundControl -> roundControl : checkTurn() : void +activate roundControl + +roundControl -> clonedTable : isValid() : boolean +activate clonedTable + +roundControl <<-- clonedTable : false +deactivate clonedTable +destroy clonedTable + +roundControl -> roundControl : rejectMove() : void +activate roundControl + +roundControl -> gameHeap : putBack({stone1}) : void +activate gameHeap + +roundControl <<-- gameHeap +deactivate gameHeap + +loop 4 times +roundControl -> gameHeap : drawStone() : Stone +activate gameHeap + +roundControl <<-- gameHeap : stone +deactivate gameHeap + +roundControl -> playerBHand : drop(stone) : void +activate playerBHand + +roundControl <<-- playerBHand +deactivate playerBHand + +end + +' reject move +roundControl <<-- roundControl +deactivate roundControl + + +' check turn +roundControl <<-- roundControl +deactivate roundControl + +roundControl -> roundControl : prepareTurn() : void +activate roundControl + + +roundControl -> table : clone() +activate table +create clonedTable2 +table -> clonedTable2 : <<create>> +activate clonedTable2 +table <<-- clonedTable2 +deactivate clonedTable2 +roundControl <<-- table : clonedTable2 +deactivate table + +roundControl -> view : setBottomPanel(START_TURN_PANEL) : void +activate view +roundControl <<-- view +deactivate view + +roundControl -> tablePanel : setStoneSets(clonedTable2) : void +activate tablePanel +roundControl <<- tablePanel +deactivate tablePanel + + +roundControl <<-- roundControl +deactivate roundControl + + +turnControl <<-- roundControl +deactivate roundControl + +playerPanel <<-- turnControl +deactivate turnControl +destroy turnControl + +[<<-- playerPanel +deactivate playerPanel + +== Initialize player A's turn == + +[-> view +activate view +view -> roundControl : startTurn() : void +activate roundControl + +roundControl -> roundState : getActivePlayer() : Player +activate roundState +roundControl <<-- roundState : playerA +deactivate roundState + +roundControl -> playerA : getPlayerSettings() : PlayerSettings +activate playerA +roundControl <<-- playerA : playerASettings +deactivate playerA + +roundControl -> playerASettings : getTurnControlType() : ITurnControlFactory.Type +activate playerASettings +roundControl <<-- playerASettings : HUMAN +deactivate playerASettings + + +roundControl -> ITurnControlFactory : getFactory(HUMAN) : ITurnControlFactory +activate ITurnControlFactory + +create humanTurnControlFactory +ITurnControlFactory -> humanTurnControlFactory2 : <<create>> +activate humanTurnControlFactory2 +humanTurnControlFactory2 -->> ITurnControlFactory +deactivate humanTurnControlFactory2 + +ITurnControlFactory -->> roundControl : humanTurnControlFactory2 : ITurnControlFactory +deactivate ITurnControlFactory + +roundControl -> humanTurnControlFactory2 : create() : ITurnControl +activate humanTurnControlFactory2 +create turnControl2 +humanTurnControlFactory -> turnControl2 : <<create>> +activate turnControl2 +turnControl2 -->> humanTurnControlFactory +deactivate turnControl2 + +humanTurnControlFactory2 -->> roundControl : turnControl2 +deactivate humanTurnControlFactory2 + +roundControl -> turnControl2 : setup(player, clonedTable2, view, false, false) : void +activate turnControl2 +turnControl2 -->> roundControl +deactivate turnControl2 + +roundControl -> turnControl2 : startTurn() : void +activate turnControl2 + +turnControl2 -> handPanel : setStones(hand.clone()) : void +activate handPanel +handPanel -->> turnControl2 +deactivate handPanel + +turnControl2 -> view : setBottomPanel(HUMAN_HAND_PANEL) : void +activate view +view -->> turnControl2 +deactivate view + + +turnControl2 -->> roundControl +deactivate turnControl2 + +view <<-- roundControl +deactivate roundControl + +[<<-- view +deactivate view + + + + + +== End of player A's turn == + +[-> playerPanel +activate playerPanel + +playerPanel -> turnControl : endOfTurn() : void +activate turnControl + +turnControl -> roundControl : endOfTurn() : void +activate roundControl + +roundControl -> roundControl : checkTurn() : void +activate roundControl + +roundControl -> clonedTable2 : isValid() : boolean +activate clonedTable2 + +roundControl <<-- clonedTable2 : true +deactivate clonedTable2 +destroy clonedTable2 + +roundControl -> roundControl : dealStone() : void +activate roundControl + + +roundControl -> gameHeap : drawStone() : Stone +activate gameHeap + +roundControl <<-- gameHeap : stone +deactivate gameHeap + +roundControl -> playerAHand : drop(stone) : void +activate playerAHand + +roundControl <<-- playerAHand +deactivate playerAHand + + +' deal stone +roundControl <<-- roundControl +deactivate roundControl + +' check turn +roundControl <<-- roundControl +deactivate roundControl + +roundControl -> roundControl : prepareTurn() : void +activate roundControl + + +roundControl -> table : clone() +activate table +create clonedTable3 +table -> clonedTable3 : <<create>> +activate clonedTable3 +table <<-- clonedTable3 +deactivate clonedTable3 +roundControl <<-- table : clonedTable3 +deactivate table + +roundControl -> view : setBottomPanel(START_TURN_PANEL) : void +activate view +roundControl <<-- view +deactivate view + +roundControl -> tablePanel : setStoneSets(clonedTable3) : void +activate tablePanel +roundControl <<- tablePanel +deactivate tablePanel + + +roundControl <<-- roundControl +deactivate roundControl + + +turnControl <<-- roundControl +deactivate roundControl + +playerPanel <<-- turnControl +deactivate turnControl +destroy turnControl + +[<<-- playerPanel +deactivate playerPanel + + +== Initialize player B's 2nd turn == + +[-> view +activate view +view -> roundControl : startTurn() : void +activate roundControl + +roundControl -> roundState : getActivePlayer() : Player +activate roundState +roundControl <<-- roundState : playerB +deactivate roundState + +roundControl -> playerB : getPlayerSettings() : PlayerSettings +activate playerB +roundControl <<-- playerB : playerBSettings +deactivate playerB + +roundControl -> playerBSettings : getTurnControlType() : ITurnControlFactory.Type +activate playerBSettings +roundControl <<-- playerBSettings : HUMAN +deactivate playerBSettings + + +roundControl -> ITurnControlFactory : getFactory(HUMAN) : ITurnControlFactory +activate ITurnControlFactory + +create humanTurnControlFactory3 +ITurnControlFactory -> humanTurnControlFactory3 : <<create>> +activate humanTurnControlFactory3 +humanTurnControlFactory3 -->> ITurnControlFactory +deactivate humanTurnControlFactory3 + +ITurnControlFactory -->> roundControl : humanTurnControlFactory3 : ITurnControlFactory +deactivate ITurnControlFactory + +roundControl -> humanTurnControlFactory3 : create() : ITurnControl +activate humanTurnControlFactory3 +create turnControl3 +humanTurnControlFactory3 -> turnControl3 : <<create>> +activate turnControl3 +turnControl3 -->> humanTurnControlFactory3 +deactivate turnControl3 + +humanTurnControlFactory3 -->> roundControl : turnControl3 +deactivate humanTurnControlFactory3 + +roundControl -> turnControl3 : setup(player, clonedTable3, view, false, false) : void +activate turnControl3 +turnControl3 -->> roundControl +deactivate turnControl3 + +roundControl -> turnControl3 : startTurn() : void +activate turnControl3 + +turnControl3 -> handPanel : setStones(hand.clone()) : void +activate handPanel +handPanel -->> turnControl3 +deactivate handPanel + +turnControl3 -> view : setBottomPanel(HUMAN_HAND_PANEL) : void +activate view +view -->> turnControl3 +deactivate view + + +turnControl3 -->> roundControl +deactivate turnControl3 + +view <<-- roundControl +deactivate roundControl + +[<<-- view +deactivate view + +== Player B's three stone set == + + +' first stone +[-> handPanel +activate handPanel + +handPanel -> turnControl3 : stoneClick(stone2, false) : void +activate turnControl3 + +turnControl3 -> view : setSelectedStones({stone2}) : void +activate view +turnControl3 <<- view +deactivate view + +handPanel <<-- turnControl3 +deactivate turnControl3 + +[<<-- handPanel +deactivate handPanel + +' second stone +[-> handPanel +activate handPanel + +handPanel -> turnControl3 : stoneClick(stone3, true) : void +activate turnControl3 + +turnControl3 -> view : setSelectedStones({stone2, stone3}) : void +activate view +turnControl3 <<- view +deactivate view + +handPanel <<-- turnControl3 +deactivate turnControl3 + +[<<-- handPanel +deactivate handPanel + +' third stone +[-> handPanel +activate handPanel + +handPanel -> turnControl3 : stoneClick(stone4, true) : void +activate turnControl3 + +turnControl3 -> view : setSelectedStones({stone2, stone3, stone4}) : void +activate view +turnControl3 <<- view +deactivate view + +handPanel <<-- turnControl3 +deactivate turnControl3 + +[<<-- handPanel +deactivate handPanel + +' put down + +[-> tablePanel +activate tablePanel + +tablePanel -> turnControl3 : tableClick(newPosition2) +activate turnControl3 +'pickups + +turnControl3 -> turnControl3 : pickUpSelectedStones() : void +activate turnControl3 + +turnControl3 -> playerBHand : pickUp(stone2) : boolean +activate playerBHand +turnControl3 <<-- playerBHand : true +deactivate playerBHand + +turnControl3 -> playerBHand : pickUp(stone3) : boolean +activate playerBHand +turnControl3 <<-- playerBHand : true +deactivate playerBHand + +turnControl3 -> playerBHand : pickUp(stone4) : boolean +activate playerBHand +turnControl3 <<-- playerBHand : true +deactivate playerBHand + + +turnControl3 <<-- turnControl3 +deactivate turnControl3 + +turnControl3 -> clonedTable3 : drop(stoneSet2, newPosition2) : void +activate clonedTable3 +turnControl3 <<-- clonedTable3 +deactivate clonedTable3 + + +turnControl3 -> tablePanel : setStoneSets(clonedTable3) : void +activate tablePanel +turnControl3 <<- tablePanel +deactivate tablePanel + +turnControl3 -> handPanel : setStones(playerBHand) : void +activate handPanel +turnControl3 <<- handPanel +deactivate handPanel + +turnControl3 -> view : setSelectedStones({}) : void +activate view +turnControl3 <<- view +deactivate view + +tablePanel <<-- turnControl3 +deactivate turnControl3 + +[<<-- tablePanel +deactivate tablePanel + +== Player B ends the 2nd turn == + +[-> playerPanel +activate playerPanel + +playerPanel -> turnControl3 : endOfTurn() : void +activate turnControl3 + +turnControl3 -> roundControl : endOfTurn() : void +activate roundControl + +roundControl -> roundControl : checkTurn() : void +activate roundControl + +roundControl -> clonedTable3 : isValid() : boolean +activate clonedTable3 + +roundControl <<-- clonedTable3 : true +deactivate clonedTable3 + +' check turn +roundControl <<-- roundControl +deactivate roundControl + +roundControl -> playerBHand : getSize() : int +activate playerBHand + +roundControl <<-- playerBHand : 10 +deactivate playerBHand + +roundControl -> roundControl : prepareTurn() : void +activate roundControl + +roundControl -> clonedTable3 : clone() +activate clonedTable3 +create clonedTable4 +table -> clonedTable4 : <<create>> +activate clonedTable4 +table <<-- clonedTable4 +deactivate clonedTable4 +roundControl <<-- clonedTable3 : clonedTable4 +deactivate clonedTable3 + +roundControl -> view : setBottomPanel(START_TURN_PANEL) : void +activate view +roundControl <<-- view +deactivate view + +roundControl -> tablePanel : setStoneSets(clonedTable4) : void +activate tablePanel +roundControl <<- tablePanel +deactivate tablePanel + +roundControl <<-- roundControl +deactivate roundControl + +turnControl3 <<-- roundControl +deactivate roundControl + +playerPanel <<-- turnControl3 +deactivate turnControl3 +destroy turnControl3 + +[<<-- playerPanel +deactivate playerPanel + +== Initialize player A's 2nd turn == + +[-> view +activate view +view -> roundControl : startTurn() : void +activate roundControl + +roundControl -> roundState : getActivePlayer() : Player +activate roundState +roundControl <<-- roundState : playerA +deactivate roundState + +roundControl -> playerA : getPlayerSettings() : PlayerSettings +activate playerA +roundControl <<-- playerA : playerASettings +deactivate playerA + +roundControl -> playerASettings : getTurnControlType() : ITurnControlFactory.Type +activate playerASettings +roundControl <<-- playerASettings : HUMAN +deactivate playerASettings + + +roundControl -> ITurnControlFactory : getFactory(HUMAN) : ITurnControlFactory +activate ITurnControlFactory + +create humanTurnControlFactory +ITurnControlFactory -> humanTurnControlFactory4 : <<create>> +activate humanTurnControlFactory4 +humanTurnControlFactory4 -->> ITurnControlFactory +deactivate humanTurnControlFactory4 + +ITurnControlFactory -->> roundControl : humanTurnControlFactory4 : ITurnControlFactory +deactivate ITurnControlFactory + +roundControl -> humanTurnControlFactory4 : create() : ITurnControl +activate humanTurnControlFactory4 +create turnControl4 +humanTurnControlFactory -> turnControl4 : <<create>> +activate turnControl4 +turnControl4 -->> humanTurnControlFactory +deactivate turnControl4 + +humanTurnControlFactory4 -->> roundControl : turnControl4 +deactivate humanTurnControlFactory4 + +roundControl -> turnControl4 : setup(player, clonedTable4, view, false, false) : void +activate turnControl4 +turnControl4 -->> roundControl +deactivate turnControl4 + +roundControl -> turnControl4 : startTurn() : void +activate turnControl4 + +turnControl4 -> handPanel : setStones(hand.clone()) : void +activate handPanel +handPanel -->> turnControl4 +deactivate handPanel + +turnControl4 -> view : setBottomPanel(HUMAN_HAND_PANEL) : void +activate view +view -->> turnControl4 +deactivate view + + +turnControl4 -->> roundControl +deactivate turnControl4 + +view <<-- roundControl +deactivate roundControl + +[<<-- view +deactivate view + +== Player A appends two stones to set == + +[-> handPanel +activate handPanel + +handPanel -> turnControl4 : stoneClick(stone5, false) : void +activate turnControl4 + +turnControl4 -> view : setSelectedStones({stone5}) : void +activate view +turnControl4 <<- view +deactivate view + +handPanel <<-- turnControl4 +deactivate turnControl4 + +[<<-- handPanel +deactivate handPanel + +[-> handPanel +activate handPanel + +handPanel -> turnControl4 : stoneClick(stone6, true) : void +activate turnControl4 + +turnControl4 -> view : setSelectedStones({stone5, stone6}) : void +activate view +turnControl4 <<- view +deactivate view + +handPanel <<-- turnControl4 +deactivate turnControl4 + +[<<-- handPanel +deactivate handPanel + + +[-> tablePanel +activate tablePanel + +tablePanel -> turnControl4 : connectorClick(stoneSet3, true) : void +activate turnControl4 + +' TODO self calls? + +turnControl4 -> turnControl4 : pickUpSelectedStones() : void +activate turnControl4 + +turnControl4 -> playerAHand : pickUp(stone5) : boolean +activate playerAHand +turnControl4 <<-- playerAHand : true +deactivate playerAHand + +turnControl4 -> playerAHand : pickUp(stone6) : boolean +activate playerAHand +turnControl4 <<-- playerAHand : true +deactivate playerAHand + + +turnControl4 <<-- turnControl4 +deactivate turnControl4 + + +turnControl4 -> clonedTable4 : getPosition(stoneSet3) : Position +activate clonedTable4 +turnControl4 <<-- clonedTable4 : position2 +deactivate clonedTable4 + +turnControl4 -> clonedTable4 : pickUp(stoneSet3) : boolean +activate clonedTable4 +turnControl4 <<-- clonedTable4 : true +deactivate clonedTable4 + +turnControl4 -> clonedTable4 : drop(joinedStoneSet2, newPosition2) : void +activate clonedTable4 +turnControl4 <<-- clonedTable4 +deactivate clonedTable4 + +turnControl4 -> tablePanel : setStoneSets(clonedTable4) : void +activate tablePanel +turnControl4 <<- tablePanel +deactivate tablePanel + +turnControl4 -> handPanel : setStones(playerAHand) : void +activate handPanel +turnControl4 <<- handPanel +deactivate handPanel + +turnControl4 -> view : setSelectedStones({}) : void +activate view +turnControl4 <<- view +deactivate view + + +tablePanel <<-- turnControl4 +deactivate turnControl4 + +[<<-- tablePanel +deactivate tablePanel + + +== Player A ends the 2nd turn == + +[-> playerPanel +activate playerPanel + +playerPanel -> turnControl4 : endOfTurn() : void +activate turnControl4 + +turnControl4 -> roundControl : endOfTurn() : void +activate roundControl + +roundControl -> roundControl : checkTurn() : void +activate roundControl + +roundControl -> clonedTable4 : isValid() : boolean +activate clonedTable4 + +roundControl <<-- clonedTable4 : true +deactivate clonedTable4 + +' check turn +roundControl <<-- roundControl +deactivate roundControl + +roundControl -> playerAHand : getSize() : int +activate playerAHand + +roundControl <<-- playerAHand : 0 +deactivate playerAHand + +roundControl -> roundControl : score() +activate roundControl + +roundControl -> playerAHand : getSize() : int +activate playerAHand + +roundControl <<-- playerAHand : 0 +deactivate playerAHand + +roundControl -> playerAHand : getStonePoints() : int +activate playerAHand + +roundControl <<-- playerAHand : 0 +deactivate playerAHand + +roundControl -> playerBHand : getSize() : int +activate playerBHand + +roundControl <<-- playerBHand : 10 +deactivate playerBHand + +roundControl -> playerBHand : getStonePoints() : int +activate playerBHand + +roundControl <<-- playerBHand : 42 +deactivate playerBHand + +roundControl <<-- roundControl +deactivate roundControl + +[<- roundControl : endOfRoundEvent.emit(score) +[-->> roundControl + +turnControl4 <<-- roundControl +deactivate roundControl + +playerPanel <<-- turnControl4 +deactivate turnControl4 + +[<<-- playerPanel +deactivate playerPanel + +@enduml + + + +@startuml img/sequence_01.png +hide footbox + +participant view as "view : View" +participant handPanel as "handPanel : HandPanel" +participant roundControl as "roundControl : RoundControl" +participant ITurnControlFactory +participant humanTurnControlFactory as "humanTurnControlFactory : ITurnControlFactory" +participant turnControl as "turnControl : HumanTurnControl" +participant roundState as "roundState : RoundState" +participant playerB as "playerB : Player" +participant playerBSettings as "playerBSettings : PlayerSettings" + +== Initialize player B's turn == + +[-> view +activate view +view -> roundControl : startTurn() : void +activate roundControl + +roundControl -> roundState : getActivePlayer() : Player +activate roundState +roundControl <<-- roundState : playerB +deactivate roundState + +roundControl -> playerB : getPlayerSettings() : PlayerSettings +activate playerB +roundControl <<-- playerB : playerBSettings +deactivate playerB + +roundControl -> playerBSettings : getTurnControlType() : ITurnControlFactory.Type +activate playerBSettings +roundControl <<-- playerBSettings : HUMAN +deactivate playerBSettings + + +roundControl -> ITurnControlFactory : getFactory(HUMAN) : ITurnControlFactory +activate ITurnControlFactory + +create humanTurnControlFactory +ITurnControlFactory -> humanTurnControlFactory : <<create>> +activate humanTurnControlFactory +humanTurnControlFactory -->> ITurnControlFactory +deactivate humanTurnControlFactory + +ITurnControlFactory -->> roundControl : humanTurnControlFactory : ITurnControlFactory +deactivate ITurnControlFactory + +roundControl -> humanTurnControlFactory : create() : ITurnControl +activate humanTurnControlFactory +create turnControl +humanTurnControlFactory -> turnControl : <<create>> +activate turnControl +turnControl -->> humanTurnControlFactory +deactivate turnControl + +humanTurnControlFactory -->> roundControl : turnControl +deactivate humanTurnControlFactory + +' roundControl -> table : clone() +' activate table +' create clonedTable +' table -> clonedTable : <<create>> +' activate clonedTable +' table <<-- clonedTable +' deactivate clonedTable +' roundControl <<-- table : clonedTable +' deactivate table + +roundControl -> turnControl : setup(player, clonedTable, view, false, false) : void +activate turnControl +turnControl -->> roundControl +deactivate turnControl + +roundControl -> turnControl : startTurn() : void +activate turnControl + +turnControl -> handPanel : setStones(hand.clone()) : void +activate handPanel +handPanel -->> turnControl +deactivate handPanel + +turnControl -> view : setBottomPanel(HUMAN_HAND_PANEL) : void +activate view +view -->> turnControl +deactivate view + + +turnControl -->> roundControl +deactivate turnControl + +view <<-- roundControl +deactivate roundControl + +[<<-- view +deactivate view + +@enduml + +@startuml img/sequence_02.png +hide footbox + +participant view as "view : View" +participant handPanel as "handPanel : HandPanel" +participant playerPanel as "playerPanel : PlayerPanel" +participant tablePanel as "tablePanel : TablePanel" +participant turnControl as "turnControl : HumanTurnControl" +participant clonedTable as "clonedTable : Table" + +== Player B appends stone to set == + +[-> handPanel +activate handPanel + +handPanel -> turnControl : stoneClick(stone1, false) : void +activate turnControl + +turnControl -> view : setSelectedStones({stone1}) : void +activate view +turnControl <<- view +deactivate view + +handPanel <<-- turnControl +deactivate turnControl + +[<<-- handPanel +deactivate handPanel + +[-> tablePanel +activate tablePanel + +tablePanel -> turnControl : connectorClick(stoneSet1, true) : void +activate turnControl + +' TODO self calls? + +turnControl -> turnControl : pickUpSelectedStones() : void +activate turnControl + +turnControl -> playerBHand : pickUp(stone1) : boolean +activate playerBHand +turnControl <<-- playerBHand : true +deactivate playerBHand + +turnControl <<-- turnControl +deactivate turnControl + + +turnControl -> clonedTable : getPosition(stoneSet1) : Position +activate clonedTable +turnControl <<-- clonedTable : position +deactivate clonedTable + +turnControl -> clonedTable : pickUp(stoneSet1) : boolean +activate clonedTable +turnControl <<-- clonedTable : true +deactivate clonedTable + +turnControl -> clonedTable : drop(joinedStoneSet, newPosition) : void +activate clonedTable +turnControl <<-- clonedTable +deactivate clonedTable + +turnControl -> tablePanel : setStoneSets(clonedTable) : void +activate tablePanel +turnControl <<- tablePanel +deactivate tablePanel + +turnControl -> handPanel : setStones(playerBHand) : void +activate handPanel +turnControl <<- handPanel +deactivate handPanel + +turnControl -> view : setSelectedStones({}) : void +activate view +turnControl <<- view +deactivate view + + +tablePanel <<-- turnControl +deactivate turnControl + +[<<-- tablePanel +deactivate tablePanel + +@enduml + +@startuml img/sequence_03.png +hide footbox + +== End of player B's turn == + +participant view as "view : View" +participant playerPanel as "playerPanel : PlayerPanel" +participant tablePanel as "tablePanel : TablePanel" +participant roundControl as "roundControl : RoundControl" +participant turnControl as "turnControl : HumanTurnControl" +participant table as "table : Table" +participant clonedTable as "clonedTable : Table" +participant clonedTable2 as "clonedTable2 : Table" +participant playerBHand as "playerBHand : Hand" +participant gameHeap as "gameHeap : StoneHeap" + +[-> playerPanel +activate playerPanel + +playerPanel -> turnControl : endOfTurn() : void +activate turnControl + +turnControl -> roundControl : endOfTurn() : void +activate roundControl + +roundControl -> roundControl : checkTurn() : void +activate roundControl + +roundControl -> clonedTable : isValid() : boolean +activate clonedTable + +roundControl <<-- clonedTable : false +deactivate clonedTable +destroy clonedTable + +roundControl -> roundControl : rejectMove() : void +activate roundControl + +roundControl -> gameHeap : putBack({stone1}) : void +activate gameHeap + +roundControl <<-- gameHeap +deactivate gameHeap + +loop 4 times +roundControl -> gameHeap : drawStone() : Stone +activate gameHeap + +roundControl <<-- gameHeap : stone +deactivate gameHeap + +roundControl -> playerBHand : drop(stone) : void +activate playerBHand + +roundControl <<-- playerBHand +deactivate playerBHand + +end + +' reject move +roundControl <<-- roundControl +deactivate roundControl + + +' check turn +roundControl <<-- roundControl +deactivate roundControl + +roundControl -> roundControl : prepareTurn() : void +activate roundControl + + +roundControl -> table : clone() +activate table +create clonedTable2 +table -> clonedTable2 : <<create>> +activate clonedTable2 +table <<-- clonedTable2 +deactivate clonedTable2 +roundControl <<-- table : clonedTable2 +deactivate table + +roundControl -> view : setBottomPanel(START_TURN_PANEL) : void +activate view +roundControl <<-- view +deactivate view + +roundControl -> tablePanel : setStoneSets(clonedTable2) : void +activate tablePanel +roundControl <<- tablePanel +deactivate tablePanel + + +roundControl <<-- roundControl +deactivate roundControl + + +turnControl <<-- roundControl +deactivate roundControl + +playerPanel <<-- turnControl +deactivate turnControl +destroy turnControl + +[<<-- playerPanel +deactivate playerPanel + + +@enduml + +@startuml img/sequence_04.png +hide footbox + +participant view as "view : View" +participant handPanel as "handPanel : HandPanel" +participant roundControl as "roundControl : RoundControl" +participant ITurnControlFactory +participant humanTurnControlFactory as "humanTurnControlFactory : ITurnControlFactory" +participant humanTurnControlFactory2 as "humanTurnControlFactory : ITurnControlFactory" +participant turnControl2 as "turnControl : HumanTurnControl" +participant roundState as "roundState : RoundState" +participant clonedTable2 as "clonedTable2 : Table" +participant playerA as "playerA : Player" +participant playerASettings as "playerASettings : PlayerSettings" + + +== Initialize player A's turn == + +[-> view +activate view +view -> roundControl : startTurn() : void +activate roundControl + +roundControl -> roundState : getActivePlayer() : Player +activate roundState +roundControl <<-- roundState : playerA +deactivate roundState + +roundControl -> playerA : getPlayerSettings() : PlayerSettings +activate playerA +roundControl <<-- playerA : playerASettings +deactivate playerA + +roundControl -> playerASettings : getTurnControlType() : ITurnControlFactory.Type +activate playerASettings +roundControl <<-- playerASettings : HUMAN +deactivate playerASettings + + +roundControl -> ITurnControlFactory : getFactory(HUMAN) : ITurnControlFactory +activate ITurnControlFactory + +create humanTurnControlFactory +ITurnControlFactory -> humanTurnControlFactory2 : <<create>> +activate humanTurnControlFactory2 +humanTurnControlFactory2 -->> ITurnControlFactory +deactivate humanTurnControlFactory2 + +ITurnControlFactory -->> roundControl : humanTurnControlFactory2 : ITurnControlFactory +deactivate ITurnControlFactory + +roundControl -> humanTurnControlFactory2 : create() : ITurnControl +activate humanTurnControlFactory2 +create turnControl2 +humanTurnControlFactory -> turnControl2 : <<create>> +activate turnControl2 +turnControl2 -->> humanTurnControlFactory +deactivate turnControl2 + +humanTurnControlFactory2 -->> roundControl : turnControl2 +deactivate humanTurnControlFactory2 + +roundControl -> turnControl2 : setup(player, clonedTable2, view, false, false) : void +activate turnControl2 +turnControl2 -->> roundControl +deactivate turnControl2 + +roundControl -> turnControl2 : startTurn() : void +activate turnControl2 + +turnControl2 -> handPanel : setStones(hand.clone()) : void +activate handPanel +handPanel -->> turnControl2 +deactivate handPanel + +turnControl2 -> view : setBottomPanel(HUMAN_HAND_PANEL) : void +activate view +view -->> turnControl2 +deactivate view + + +turnControl2 -->> roundControl +deactivate turnControl2 + +view <<-- roundControl +deactivate roundControl + +[<<-- view +deactivate view + + +@enduml + +@startuml img/sequence_05.png +hide footbox + +participant view as "view : View" +participant playerPanel as "playerPanel : PlayerPanel" +participant tablePanel as "tablePanel : TablePanel" +participant roundControl as "roundControl : RoundControl" +participant turnControl as "turnControl : HumanTurnControl" +participant table as "table : Table" +participant clonedTable2 as "clonedTable2 : Table" +participant clonedTable3 as "clonedTable3 : Table" +participant playerAHand as "playerAHand : Hand" +participant gameHeap as "gameHeap : StoneHeap" + +== End of player A's turn == + +[-> playerPanel +activate playerPanel + +playerPanel -> turnControl : endOfTurn() : void +activate turnControl + +turnControl -> roundControl : endOfTurn() : void +activate roundControl + +roundControl -> roundControl : checkTurn() : void +activate roundControl + +roundControl -> clonedTable2 : isValid() : boolean +activate clonedTable2 + +roundControl <<-- clonedTable2 : true +deactivate clonedTable2 +destroy clonedTable2 + +roundControl -> roundControl : dealStone() : void +activate roundControl + + +roundControl -> gameHeap : drawStone() : Stone +activate gameHeap + +roundControl <<-- gameHeap : stone +deactivate gameHeap + +roundControl -> playerAHand : drop(stone) : void +activate playerAHand + +roundControl <<-- playerAHand +deactivate playerAHand + + +' deal stone +roundControl <<-- roundControl +deactivate roundControl + +' check turn +roundControl <<-- roundControl +deactivate roundControl + +roundControl -> roundControl : prepareTurn() : void +activate roundControl + + +roundControl -> table : clone() +activate table +create clonedTable3 +table -> clonedTable3 : <<create>> +activate clonedTable3 +table <<-- clonedTable3 +deactivate clonedTable3 +roundControl <<-- table : clonedTable3 +deactivate table + +roundControl -> view : setBottomPanel(START_TURN_PANEL) : void +activate view +roundControl <<-- view +deactivate view + +roundControl -> tablePanel : setStoneSets(clonedTable3) : void +activate tablePanel +roundControl <<- tablePanel +deactivate tablePanel + + +roundControl <<-- roundControl +deactivate roundControl + + +turnControl <<-- roundControl +deactivate roundControl + +playerPanel <<-- turnControl +deactivate turnControl +destroy turnControl + +[<<-- playerPanel +deactivate playerPanel + +@enduml + +@startuml img/sequence_06.png +hide footbox +participant view as "view : View" +participant handPanel as "handPanel : HandPanel" +participant roundControl as "roundControl : RoundControl" +participant ITurnControlFactory +participant humanTurnControlFactory3 as "humanTurnControlFactory : ITurnControlFactory" +participant turnControl3 as "turnControl : HumanTurnControl" +participant roundState as "roundState : RoundState" +participant clonedTable3 as "clonedTable3 : Table" +participant playerB as "playerB : Player" +participant playerBSettings as "playerBSettings : PlayerSettings" + + +== Initialize player B's 2nd turn == + +[-> view +activate view +view -> roundControl : startTurn() : void +activate roundControl + +roundControl -> roundState : getActivePlayer() : Player +activate roundState +roundControl <<-- roundState : playerB +deactivate roundState + +roundControl -> playerB : getPlayerSettings() : PlayerSettings +activate playerB +roundControl <<-- playerB : playerBSettings +deactivate playerB + +roundControl -> playerBSettings : getTurnControlType() : ITurnControlFactory.Type +activate playerBSettings +roundControl <<-- playerBSettings : HUMAN +deactivate playerBSettings + + +roundControl -> ITurnControlFactory : getFactory(HUMAN) : ITurnControlFactory +activate ITurnControlFactory + +create humanTurnControlFactory3 +ITurnControlFactory -> humanTurnControlFactory3 : <<create>> +activate humanTurnControlFactory3 +humanTurnControlFactory3 -->> ITurnControlFactory +deactivate humanTurnControlFactory3 + +ITurnControlFactory -->> roundControl : humanTurnControlFactory3 : ITurnControlFactory +deactivate ITurnControlFactory + +roundControl -> humanTurnControlFactory3 : create() : ITurnControl +activate humanTurnControlFactory3 +create turnControl3 +humanTurnControlFactory3 -> turnControl3 : <<create>> +activate turnControl3 +turnControl3 -->> humanTurnControlFactory3 +deactivate turnControl3 + +humanTurnControlFactory3 -->> roundControl : turnControl3 +deactivate humanTurnControlFactory3 + +roundControl -> turnControl3 : setup(player, clonedTable3, view, false, false) : void +activate turnControl3 +turnControl3 -->> roundControl +deactivate turnControl3 + +roundControl -> turnControl3 : startTurn() : void +activate turnControl3 + +turnControl3 -> handPanel : setStones(hand.clone()) : void +activate handPanel +handPanel -->> turnControl3 +deactivate handPanel + +turnControl3 -> view : setBottomPanel(HUMAN_HAND_PANEL) : void +activate view +view -->> turnControl3 +deactivate view + + +turnControl3 -->> roundControl +deactivate turnControl3 + +view <<-- roundControl +deactivate roundControl + +[<<-- view +deactivate view + +@enduml + +@startuml img/sequence_07.png +hide footbox + +participant view as "view : View" +participant handPanel as "handPanel : HandPanel" +participant tablePanel as "tablePanel : TablePanel" +participant turnControl3 as "turnControl : HumanTurnControl" +participant table as "table : Table" +participant clonedTable3 as "clonedTable3 : Table" +participant playerBHand as "playerBHand : Hand" + +== Player B's three stone set == + + +' first stone +[-> handPanel +activate handPanel + +handPanel -> turnControl3 : stoneClick(stone2, false) : void +activate turnControl3 + +turnControl3 -> view : setSelectedStones({stone2}) : void +activate view +turnControl3 <<- view +deactivate view + +handPanel <<-- turnControl3 +deactivate turnControl3 + +[<<-- handPanel +deactivate handPanel + +' second stone +[-> handPanel +activate handPanel + +handPanel -> turnControl3 : stoneClick(stone3, true) : void +activate turnControl3 + +turnControl3 -> view : setSelectedStones({stone2, stone3}) : void +activate view +turnControl3 <<- view +deactivate view + +handPanel <<-- turnControl3 +deactivate turnControl3 + +[<<-- handPanel +deactivate handPanel + +' third stone +[-> handPanel +activate handPanel + +handPanel -> turnControl3 : stoneClick(stone4, true) : void +activate turnControl3 + +turnControl3 -> view : setSelectedStones({stone2, stone3, stone4}) : void +activate view +turnControl3 <<- view +deactivate view + +handPanel <<-- turnControl3 +deactivate turnControl3 + +[<<-- handPanel +deactivate handPanel + +' put down + +[-> tablePanel +activate tablePanel + +tablePanel -> turnControl3 : tableClick(newPosition2) +activate turnControl3 +'pickups + +turnControl3 -> turnControl3 : pickUpSelectedStones() : void +activate turnControl3 + +turnControl3 -> playerBHand : pickUp(stone2) : boolean +activate playerBHand +turnControl3 <<-- playerBHand : true +deactivate playerBHand + +turnControl3 -> playerBHand : pickUp(stone3) : boolean +activate playerBHand +turnControl3 <<-- playerBHand : true +deactivate playerBHand + +turnControl3 -> playerBHand : pickUp(stone4) : boolean +activate playerBHand +turnControl3 <<-- playerBHand : true +deactivate playerBHand + + +turnControl3 <<-- turnControl3 +deactivate turnControl3 + +turnControl3 -> clonedTable3 : drop(stoneSet2, newPosition2) : void +activate clonedTable3 +turnControl3 <<-- clonedTable3 +deactivate clonedTable3 + + +turnControl3 -> tablePanel : setStoneSets(clonedTable3) : void +activate tablePanel +turnControl3 <<- tablePanel +deactivate tablePanel + +turnControl3 -> handPanel : setStones(playerBHand) : void +activate handPanel +turnControl3 <<- handPanel +deactivate handPanel + +turnControl3 -> view : setSelectedStones({}) : void +activate view +turnControl3 <<- view +deactivate view + +tablePanel <<-- turnControl3 +deactivate turnControl3 + +[<<-- tablePanel +deactivate tablePanel + +@enduml + +@startuml img/sequence_08.png +hide footbox + +participant view as "view : View" +participant playerPanel as "playerPanel : PlayerPanel" +participant tablePanel as "tablePanel : TablePanel" +participant roundControl as "roundControl : RoundControl" +participant turnControl3 as "turnControl : HumanTurnControl" +participant table as "table : Table" +participant clonedTable3 as "clonedTable3 : Table" +participant clonedTable4 as "clonedTable4 : Table" +participant playerBHand as "playerBHand : Hand" + +== Player B ends the 2nd turn == + +[-> playerPanel +activate playerPanel + +playerPanel -> turnControl3 : endOfTurn() : void +activate turnControl3 + +turnControl3 -> roundControl : endOfTurn() : void +activate roundControl + +roundControl -> roundControl : checkTurn() : void +activate roundControl + +roundControl -> clonedTable3 : isValid() : boolean +activate clonedTable3 + +roundControl <<-- clonedTable3 : true +deactivate clonedTable3 + +' check turn +roundControl <<-- roundControl +deactivate roundControl + +roundControl -> playerBHand : getSize() : int +activate playerBHand + +roundControl <<-- playerBHand : 10 +deactivate playerBHand + +roundControl -> roundControl : prepareTurn() : void +activate roundControl + +roundControl -> clonedTable3 : clone() +activate clonedTable3 +create clonedTable4 +table -> clonedTable4 : <<create>> +activate clonedTable4 +table <<-- clonedTable4 +deactivate clonedTable4 +roundControl <<-- clonedTable3 : clonedTable4 +deactivate clonedTable3 + +roundControl -> view : setBottomPanel(START_TURN_PANEL) : void +activate view +roundControl <<-- view +deactivate view + +roundControl -> tablePanel : setStoneSets(clonedTable4) : void +activate tablePanel +roundControl <<- tablePanel +deactivate tablePanel + +roundControl <<-- roundControl +deactivate roundControl + +turnControl3 <<-- roundControl +deactivate roundControl + +playerPanel <<-- turnControl3 +deactivate turnControl3 +destroy turnControl3 + +[<<-- playerPanel +deactivate playerPanel + +@enduml + +@startuml img/sequence_09.png +hide footbox + +participant view as "view : View" +participant handPanel as "handPanel : HandPanel" +participant roundControl as "roundControl : RoundControl" +participant ITurnControlFactory +participant humanTurnControlFactory as "humanTurnControlFactory : ITurnControlFactory" +participant humanTurnControlFactory4 as "humanTurnControlFactory : ITurnControlFactory" +participant turnControl4 as "turnControl : HumanTurnControl" +participant roundState as "roundState : RoundState" +participant clonedTable4 as "clonedTable4 : Table" +participant playerA as "playerA : Player" +participant playerASettings as "playerASettings : PlayerSettings" + + +== Initialize player A's 2nd turn == + +[-> view +activate view +view -> roundControl : startTurn() : void +activate roundControl + +roundControl -> roundState : getActivePlayer() : Player +activate roundState +roundControl <<-- roundState : playerA +deactivate roundState + +roundControl -> playerA : getPlayerSettings() : PlayerSettings +activate playerA +roundControl <<-- playerA : playerASettings +deactivate playerA + +roundControl -> playerASettings : getTurnControlType() : ITurnControlFactory.Type +activate playerASettings +roundControl <<-- playerASettings : HUMAN +deactivate playerASettings + + +roundControl -> ITurnControlFactory : getFactory(HUMAN) : ITurnControlFactory +activate ITurnControlFactory + +create humanTurnControlFactory +ITurnControlFactory -> humanTurnControlFactory4 : <<create>> +activate humanTurnControlFactory4 +humanTurnControlFactory4 -->> ITurnControlFactory +deactivate humanTurnControlFactory4 + +ITurnControlFactory -->> roundControl : humanTurnControlFactory4 : ITurnControlFactory +deactivate ITurnControlFactory + +roundControl -> humanTurnControlFactory4 : create() : ITurnControl +activate humanTurnControlFactory4 +create turnControl4 +humanTurnControlFactory -> turnControl4 : <<create>> +activate turnControl4 +turnControl4 -->> humanTurnControlFactory +deactivate turnControl4 + +humanTurnControlFactory4 -->> roundControl : turnControl4 +deactivate humanTurnControlFactory4 + +roundControl -> turnControl4 : setup(player, clonedTable4, view, false, false) : void +activate turnControl4 +turnControl4 -->> roundControl +deactivate turnControl4 + +roundControl -> turnControl4 : startTurn() : void +activate turnControl4 + +turnControl4 -> handPanel : setStones(hand.clone()) : void +activate handPanel +handPanel -->> turnControl4 +deactivate handPanel + +turnControl4 -> view : setBottomPanel(HUMAN_HAND_PANEL) : void +activate view +view -->> turnControl4 +deactivate view + + +turnControl4 -->> roundControl +deactivate turnControl4 + +view <<-- roundControl +deactivate roundControl + +[<<-- view +deactivate view + +@enduml + +@startuml img/sequence_10.png +hide footbox + +participant view as "view : View" +participant handPanel as "handPanel : HandPanel" +participant tablePanel as "tablePanel : TablePanel" +participant turnControl4 as "turnControl : HumanTurnControl" +participant clonedTable4 as "clonedTable4 : Table" +participant playerAHand as "playerAHand : Hand" + +== Player A appends two stones to set == + +[-> handPanel +activate handPanel + +handPanel -> turnControl4 : stoneClick(stone5, false) : void +activate turnControl4 + +turnControl4 -> view : setSelectedStones({stone5}) : void +activate view +turnControl4 <<- view +deactivate view + +handPanel <<-- turnControl4 +deactivate turnControl4 + +[<<-- handPanel +deactivate handPanel + +[-> handPanel +activate handPanel + +handPanel -> turnControl4 : stoneClick(stone6, true) : void +activate turnControl4 + +turnControl4 -> view : setSelectedStones({stone5, stone6}) : void +activate view +turnControl4 <<- view +deactivate view + +handPanel <<-- turnControl4 +deactivate turnControl4 + +[<<-- handPanel +deactivate handPanel + + +[-> tablePanel +activate tablePanel + +tablePanel -> turnControl4 : connectorClick(stoneSet3, true) : void +activate turnControl4 + +' TODO self calls? + +turnControl4 -> turnControl4 : pickUpSelectedStones() : void +activate turnControl4 + +turnControl4 -> playerAHand : pickUp(stone5) : boolean +activate playerAHand +turnControl4 <<-- playerAHand : true +deactivate playerAHand + +turnControl4 -> playerAHand : pickUp(stone6) : boolean +activate playerAHand +turnControl4 <<-- playerAHand : true +deactivate playerAHand + + +turnControl4 <<-- turnControl4 +deactivate turnControl4 + + +turnControl4 -> clonedTable4 : getPosition(stoneSet3) : Position +activate clonedTable4 +turnControl4 <<-- clonedTable4 : position2 +deactivate clonedTable4 + +turnControl4 -> clonedTable4 : pickUp(stoneSet3) : boolean +activate clonedTable4 +turnControl4 <<-- clonedTable4 : true +deactivate clonedTable4 + +turnControl4 -> clonedTable4 : drop(joinedStoneSet2, newPosition2) : void +activate clonedTable4 +turnControl4 <<-- clonedTable4 +deactivate clonedTable4 + +turnControl4 -> tablePanel : setStoneSets(clonedTable4) : void +activate tablePanel +turnControl4 <<- tablePanel +deactivate tablePanel + +turnControl4 -> handPanel : setStones(playerAHand) : void +activate handPanel +turnControl4 <<- handPanel +deactivate handPanel + +turnControl4 -> view : setSelectedStones({}) : void +activate view +turnControl4 <<- view +deactivate view + + +tablePanel <<-- turnControl4 +deactivate turnControl4 + +[<<-- tablePanel +deactivate tablePanel + +@enduml + +@startuml img/sequence_11.png +hide footbox + +participant playerPanel as "playerPanel : PlayerPanel" +participant roundControl as "roundControl : RoundControl" +participant turnControl4 as "turnControl : HumanTurnControl" +participant clonedTable4 as "clonedTable4 : Table" +participant playerAHand as "playerAHand : Hand" +participant playerBHand as "playerBHand : Hand" + +== Player A ends the 2nd turn == + +[-> playerPanel +activate playerPanel + +playerPanel -> turnControl4 : endOfTurn() : void +activate turnControl4 + +turnControl4 -> roundControl : endOfTurn() : void +activate roundControl + +roundControl -> roundControl : checkTurn() : void +activate roundControl + +roundControl -> clonedTable4 : isValid() : boolean +activate clonedTable4 + +roundControl <<-- clonedTable4 : true +deactivate clonedTable4 + +' check turn +roundControl <<-- roundControl +deactivate roundControl + +roundControl -> playerAHand : getSize() : int +activate playerAHand + +roundControl <<-- playerAHand : 0 +deactivate playerAHand + +roundControl -> roundControl : score() +activate roundControl + +roundControl -> playerAHand : getSize() : int +activate playerAHand + +roundControl <<-- playerAHand : 0 +deactivate playerAHand + +roundControl -> playerAHand : getStonePoints() : int +activate playerAHand + +roundControl <<-- playerAHand : 0 +deactivate playerAHand + +roundControl -> playerBHand : getSize() : int +activate playerBHand + +roundControl <<-- playerBHand : 10 +deactivate playerBHand + +roundControl -> playerBHand : getStonePoints() : int +activate playerBHand + +roundControl <<-- playerBHand : 42 +deactivate playerBHand + +roundControl <<-- roundControl +deactivate roundControl + +[<- roundControl : endOfRoundEvent.emit(score) +[-->> roundControl + +turnControl4 <<-- roundControl +deactivate roundControl + +playerPanel <<-- turnControl4 +deactivate turnControl4 + +[<<-- playerPanel +deactivate playerPanel + +@enduml |