Suppose we are planning an offline poke game system with a name of CDD Game(锄大地). A player and 3 robot playmates play the game with 52 cards (without 2 jokers) on a board. A player could select 3 robot playmates and start to play the game. Also, a player could exit the game or register himself by giving a nick name, select a nick name, set the background music to initiate the game. When a player and the 3 selected robots play the game, each of them is distributed with 13 cards at random. When the player takes the turn to show cards, the player selects a group of cards and show it. The group of cards should be validated by the type of card, which is established by the rules of CDD game. When one of the players has showed all of the cards on hand, the game is over and the system will calculate the score of each player according to the game rules. Players can decide to leave or continue the game. If a player leaves the game before the end of the game, he or she would be given penalty. All of the registered players are ranked with the scores they have won. Please draw the following diagrams with the approach of OOA and OOD. Draw an activity diagram for the use case of play game.可以用字符模拟图片
时间: 2024-02-29 07:51:55 浏览: 183
我可以回答你的问题,关于 CDD Game 的问题,但是我并不能绘制 OO 设计的图。以下是我对“play game”用例的活动图描述:
```
+---------------------------+
| Play Game |
+---------------------------+
|
|
v
+---------------------------+
| Select Playmates |
+---------------------------+
|
|
v
+---------------------------+
| Distribute Cards |
+---------------------------+
|
|
v
+---------------------------+
| Take Turn to Show Cards |
+---------------------------+
|
|
v
+---------------------------+
| Validate Group of Cards |
+---------------------------+
|
|
v
+---------------------------+
| End of Game |
+---------------------------+
|
|
v
+---------------------------+
| Calculate Player Score |
+---------------------------+
|
|
v
+---------------------------+
| Decide to Leave or Continue |
+---------------------------+
```
这个活动图描述了 CDD Game 的“play game”用例,其中每个步骤都是按照特定的顺序执行的。该图表明了游戏玩家选择游戏玩家,洗牌并分配牌,轮流出牌并验证出牌,计算得分以及决定是否继续游戏或离开游戏。
阅读全文